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.