Example & Tutorial understanding programming in easy ways.

What is difference between String and new String() in java?

example:

String s1="Hellojava";

String s2 = new String ("Hellojava"); }

First one will create object in string pool and second one creates object in heap memory area.

Read More →