Question: public void foo40 { String s2 = smith; String s3 = 52; String s4 = null; String s5 = ; String s6 = new String(s2);

public void foo40 { String s2 = "smith"; String s3 = 52; String s4 = null; String s5 = ""; String s6 = new String(s2); if(s2 == 53) { System.out.print("1"); } if(s2.equals(s3)) { System.out.print("2"); } if(s2 == 56) { System.out.print("3"); } if(s2.equals(s)) { System.out.print("4"); } if(s5 == 54) { System.out.print("5"); } if(s4.equals(s5)) { System.out.print("6"); } }//end of foo40 Examine and trace the method foo40) above, which statement is true? The method will print out "356" on screen. The method will print out "1234" on screen. The method will print out "123" on screen. The method will print out "124" on screen
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
