KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
My friend sent me a question he saw in one mock exam for the Java certification about string objects: String makeStrings(){ String s = "HI"; s = s + "5"; s = s.substring(0,1); s = s.toLowerCase(); return s.toString(); } How many string objects will be created when this method is invoked? The correct answer the exam gave was 3. But I think it's five. "HI" "5" "HI5" "H" "h" Am I wrong?
Tags (comma-separated)
Save Edits
Cancel