Constructor (object-oriented programming): Difference between revisions

Content deleted Content added
Line 123:
class Example
{
Example() //non-parameterized constructor
{
this(1); //calling of constructor
System.out.println("0-arg-cons");
}
Example(int a) //parameterized constructor
{
System.out.println("1-arg-cons");