[Updated] Goldman Sachs Aptitude Test Questions and Answers
Practice List of TCS Digital Coding Questions !!!
Take 50+ FREE!! Online Data Interpretation Mock test to crack any Exams.
Technical Discussion :: Java

18 / 66

What is the difference between creating String as new() and literal?

Answer:

When 'new String()' is used, it creates a new string object in the heap memory and as when literal is used, it may return an existing object from the string pool, it exists else creates a new object.

Asked In ::

Post Your Answer Here:


Rate This: +1 -0      +
Report    

Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here

Most Popular Qs.