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 =

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!