后面两张写法可以么
1. public ListTest(){ this.coursesToSelect=new ArrayList(); } 2. public ListTest(){ ArrayList coursesToSelect=new ArrayList();} 3. public ListTest(){ List coursesToSelect=new ArrayList();}
1为老师写法,2和3编译也能通过,他们的区别在哪
1. public ListTest(){ this.coursesToSelect=new ArrayList(); } 2. public ListTest(){ ArrayList coursesToSelect=new ArrayList();} 3. public ListTest(){ List coursesToSelect=new ArrayList();}
1为老师写法,2和3编译也能通过,他们的区别在哪
2018-01-20
举报