• +91 9723535972
  • info@interviewmaterial.com

Java Interview Questions and Answers

Question - Can one create a method which gets a String and modifies it?

Answer - No. In Java, Strings are constant or immutable; their values cannot be changed after they are created, but they can be shared. Once you change a string, you actually create a new object. For example: String s = "abc"; //create a new String object representing "abc" s = s.toUpperCase(); //create another object representing "ABC"

Comment(S)

Show all Coment

Leave a Comment




NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners