58,454
社区成员
发帖
与我相关
我的任务
分享
public class T {
int id ;
String name;
double score;
public static void main(String[] args) {
T[] t = new T[2];
t[1] = new T();
t[1].id = 2;
System.out.println(t[1].id = 2);
}
}
引用楼上
public class ArrayTest {
int id;
String name;
double score;
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayTest[] t = new ArrayTest[]{new ArrayTest(), new ArrayTest()};
t[1].id=2;
System.out.println(t[1].id);
}
}