Constructure overloading

PHOTO EMBED

Fri Apr 21 2023 11:28:25 GMT+0000 (Coordinated Universal Time)

Saved by @Shankar #instanceblocks #inheritance #overloading

// constructore overriding

class Overriding2
{
	Overriding2()
	{ 
		        System.out.println("Inside the Cons-1");
	}
			
	Overriding2(int a)
		{
				System.out.println("Inside the Cons-2");
		}



	public static void main(String[] args) 
	{
		System.out.println("Hello World!");
		Overriding2 src = new Overriding2(10);
	}
}
content_copyCOPY

The constructor name should remain the same but should vary in the type of argument