What will be output of this puzzle on constructors ?
package quiz; public class Hi extends Greeting{ public static void main(String[] args) { new Hi(); new Hi("Hi"); } Hi(){this("Hello");} Hi(String s){super(s);} }
package quiz; public class Greeting { Greeting(String s){ System.out.print(s);} }
© 2015 – 2016, https:. All rights reserved. On republishing this post, you must provide link to original post
#
Hello
Hi