// 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); } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter