For Example:
public class Person {};
public class Student extends Person{};
List<Person> persons=new ArrayList();
List<Student> students=new ArrayList();
persons=students;
how can you assign students to persons? the last line will throw an error.
Change the declarition:
ReplyDeleteList persons=new ArrayList();
Now you can:
persons=students;
It's a wonderful post and very helpful, thanks for all this information about Java. You are including better information regarding this topic in an effective way.keep it up!!
ReplyDeleteandroid training in chennai
android online training in chennai
android training in bangalore
android training in hyderabad
android Training in coimbatore
android training
android online training