Java examples for Language Basics:String
How Java String object is created and used.
public class Main { public static void main(String args[]){ /* creates new empty string */ String str1 = new String(""); /* w ww . ja va 2s . c o m*/ String str2 = new String("Hello world"); String str3 = "Hello Wolrd"; System.out.println( str1.length()); } }