Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package myArray;
- import java.lang.reflect.Array;
- public class praArray {
- public static void main(String[] args) {
- Person[] array = new Person[3];
- Person one = new Person("迪丽热巴",12);
- Person two = new Person("张雪峰",22);
- Person three = new Person("考研",23);
- array[0] = one;
- array[1] = two;
- array[2] = three;
- System.out.println(array[0]);//只能打印地址值
- System.out.println(array[1]);//只能打印地址值
- System.out.println(array[2]);//只能打印地址值
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement