I'm aware of just basic concepts of java. Today I was learning about super keyword from here
http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.11.2
And in code example found this code snippet
class Test {
public static void main(String[] args) {
new T3().test(); ---> What is happening here ?
}
}
May I know what is happening with new T3().test(); ? Is it a new object ? If yest then why its not written as below ?
T3 ob = new T3().test();
Or they have written in way because return type of test() method is void. Means no reference type can be created ? Am I correct ?
Can anyone help me to understand this ? What is actually happening with this code snippet ? I just know only we use this way only when we need to create an object like this only
Classtype vrblName = new Constructor();
See Question&Answers more detail:os