package test; import java.util.*; public class myclass { public static void main(String[] args) { String[][] my2Darray = {{ "I", "love" }, { "JAVA.", "it" }, { "is", "best" }}; System.out.print("Single element retrieve result:"); System.out.print(my2Darray[0][1]); // element wise data extraction System.out.println(); System.out.print("Showing all elements of 2D array"); System.out.println(); for (int i = 0; i <3; i++) { //used to extract whole contact of 2D array System.out.println(); for (int j = 0; j < 2; j++) { System.out.print(my2Darray[i][j]); System.out.println(); } } //the code below is for deletion of all the elements of the array /*for (int i = 0; i <3; i++) { System.out.println(); for (int j = 0; j < 2; j++) { my2Darray[i][j]=null; System.out.println(); } } */ } }