Hi! I'm having a problem with my coding. I have initialized a 2d array (String), but when I try to print a value from it, it gives me null.
this is how I initialized my array.
String phone[][] = { {"A", "B","C"},
{"D", "E", "F"},
{"G","H", "I"},
{"J", "K", "L"},
{"M", "N", "O"},
{"P", "R", "S"},
{"T", "U", "V"},
{"W", "X", "Y"} };
when I try to print a value like this
System.out.println("Element in [0][2]is: "+ phone[0][2]);
it gives an error... NullPointerException:null
What have I done wrong..??
Ishani