<AptiCode/>

Question 734: What will be the output of the program?class PassS { public static void main(String [] args) { PassS p = new PassS(); p.start(); } void start() { String s1 = "slip"; String s2 = fix(s1); System.out.println(s1 + " " + s2); } String fix(String s1) { s1 = s1 + "stream"; System.out.print(s1 + " "); return "stream"; } }

tcs
wipro
infosys
general
aptitude
operators-and-assignments

When thefix()method is first entered,start()'s s1 andfix()'ss1reference variables both refer to the same String object (with a value of "slip").Fix()'ss1is reassigned to a new object that is created when the concatenation occurs (this second String object has a value of "slipstream"). When the program returns tostart(), anotherStringobject is created, referred to bys2and with a value of "stream".