What will be the output of following quiz on static in java ?
package quiz; public class SuperClass { static String s = ""; static { s += "1"; } SuperClass(){ s += "2"; } }
package quiz; public class SubClass extends SuperClass{ SubClass(){ s += "3"; } static{ new SubClass(); System.out.println(s); } {s += "4";} public static void main(String[] args) {} }
© 2015, https:. All rights reserved. On republishing this post, you must provide link to original post
#