hello

This article is just for testing ~

First

  • this is an item!
    • xxx
  • this is another item!
    • xxx

Second

  • this is an item!
    • xxx
  • this is another item!
    • xxx

Third

1
2
3
4
5
6
7
8
9
public class Demo {
public static void main(String[] args) throws Exception {
String str = new String("Hello HeiMa!"); //建立一个String对象
ArrayList<Integer> list = new ArrayList<Integer>(); //建立一个ArrayList<Integer>对象
Method m = list.getClass().getMethod("add", Object.class); //通过list类对象获取add(Object e)方法
m.invoke(list, str); //让list调用反射的add方法添加一个String对象即str
System.out.println(list.get(0)); //打印输出
}
}

测试结果显示

  1. 无序列表显示不尽人意
  2. 代码无高亮
坚持原创技术分享,您的支持将鼓励我继续创作