Scanner in = new Scanner (System.in); String str2 = ""; // "" allocates space, so str1 is not an instantiated object, and str2 has been instantiated. null is not an object, "" is an object System.out.println (str2.length ()); String str1 = null ; // str1 reference is empty. No space allocated, System.out.println (str1); System.out. println (str1.length ());