public String makeStrings() { String s="Fred"; s=s+"47"; s=s.substring(2,5); s=s.toUpperCase(); return s.toString(); } /*How many string objects will be created when this method is invoked a)1 b)2 c)3 d)4 e)5 f)6
Read questiobnm carefully It ask's for number of strings objects created when method is invoked i.e. at runtime. I think there are three string objects being created when program runs. Others are created at compile time.