public class ObjArrary {
public static void main(String[] args) {
System.out.println("Start");
//
System.out.println("------------------------");
//
String strArrary[] = new String[3];
System.out.println("strArrary.length -> " + strArrary.length);
strArrary[0] = "0";
strArrary[2] = "22";
System.out.println("strArrary[0] -> " + strArrary[0]);
System.out.println("strArrary[1] -> " + strArrary[1]); //NULL
System.out.println("strArrary[2] -> " + strArrary[2]);
System.out.println("strArrary[0].length() -> " + strArrary[0].length());
System.out.println("strArrary[2].length() -> " + strArrary[2].length());
//NULL ERROR
System.out.println("strArrary[1].length() -> " + strArrary[1].length());
//
System.out.println("------------------------");
System.out.println("End");
}
}
|