having several this() invocations in a row


Java Code: class A { private int a; private int b; A() { this(1); System.out.println("a= "+a);//a=1 System.out.println("b= "+b);//b=5 } A(int a) { this(2,5); this.a=a; } A(int a, int b) { this.a=a; this.b=b; } } public class Row_OF_This { public static void main(String args[]) { A ob=new A(); } } mh_sh_highlight_all('java');

From Object Initialization in Java
You can have several this() invocations in a row if you wish. In other words, you could have an method that invokes another with this(), and that method invokes yet another with this(), and so on. My question:
Is quote's aim above program
Posted On: Thursday 25th of October 2012 01:50:44 AM Total Views:  61
View Complete with Replies

RELATED TOPICS OF Java PROGRAMMING LANGUAGE