Computer Science, asked by mrgoodb62, 1 month ago

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

Answers

Answered by Priyananshu
1

Answer:

When we create a String object using the new() operator, it always creates a new object in heap memory. ... At a high level, both are the String objects, but the main difference comes from the point that new() operator always creates a new String object. Also, when we create a String using literal – it is interned.

marke brainliest please

Answered by mudholkaryashwant
2

When we create a String object using the new() operator, it always creates a new object in heap memory. ... At a high level, both are the String objects, but the main difference comes from the point that new() operator always creates a new String object. Also, when we create a String using literal – it is interned.20-Jul-2020

Similar questions