Waste less time on Facebook — follow Brilliant.
×

It's a general program on java...related to constructors

class Alpha { static String s= " "; protected Alpha() { s += "alpha"; } } class SubAlpha extends Alpha { private SubAlpha() { s +="sub ";

}

} public class SubSubAlpha extends Alpha { private SubSubAlpha() { s +="subsub "; }

public static void main(String[] args){ new SubSubAlpha(); System.out.println(s); } }

Note by Nichole Greece
2 years, 12 months ago

No vote yet
1 vote

Comments

There are no comments in this discussion.

×

Problem Loading...

Note Loading...

Set Loading...