Hi, I have a problem here, The code is this please tell me what is problem with java objects passed by ref.
class test { public static void main(String[] args) { String str="Some String Msg."; System.out.println("before method call test1 .."+str); test1(str); System.out.println("after method call test1 .."+str); }
public static void test1(String str) { str="some new string masg here.."; System.out.println("......."+str); } } why String object is not changing after the method test1 called.