1. A class is loaded when it is used for the first time, it is loaded from the class file (Ex. Student.class). If this class has a base class, the base class will be loaded before this class.
2. Next, the static initialization in the base class is performed which initialize the static fields of the base class, and then the static initialization of this (derived) class kicks in, which makes...
Monday, July 23, 2012
Monday, July 9, 2012
Java Generics assignment sheet
Unknown
3:42:00 PM
No comments

raw type <------ any
any <------ raw type
<?> <------ any
<? extends T> <------ <T> and <? extends T>
<? super T> <------ <T> and <? super T>
<------:...
Sunday, July 8, 2012
Java Generics Wildcards explained
Unknown
2:02:00 PM
No comments

Given a generic class, like List<T>, or any generic class:
When using this generic class, for example:
List<Student> students = StudentFactory.getStudents();
or
public class StudentList implements List<Student> {...}
or
List<? extends Student> students = StudentFactory.getStudents();
or
List<?...
Subscribe to:
Posts (Atom)