Java Quiz: Static Members in Java Last Week's AnswerThe correct answer is the code writes "[d, a, b, e]" to the standard output.This Week's QuizPurposeTo demonstrate some behaviors and tricks of static members in JavaMind training to understand what happens next.What Happens When the Following Program is Compiled and Run?public class MyClass { static int x; StringBuffer sb = new StringBuffer(); static StringBuffer sb2 = new StringBuffer(); public MyClass() { method(); method2(); } public void method(){ x += 3; sb.append(x); } public void method2(){ x += 3; sb2.append(x); } public static void main(String[] args){ MyClass mc = new MyClass(); MyClass mc2 = new MyClass(); MyClass mc3 = new MyClass(); System.out.println( + "-" + mc2.sb2); } }Let us know your thoughts in the comments, and visit Sar's site here!
Jeff Bezos' space company successfully re-flies, lands rocket
Hong Kong tailor replaces tape measure with 3D scanner
AT&T says has edge over Verizon in 5G thanks to DIRECTV lines