3.Program to create a Two-Dimensional Array
public class twoDimArray
{
public static void main(String [] args)
{
String city[][]={ {"NewYork","Muscat","London"} , {"Cairo","Beijing","CapeTown"} };
for (int i=0; i<city.length; i++)
{
for (int j=0; j<city[i].length; j++)
{
System.out.print(city[i][j]+"\t");
}
System.out.println();
}}}
Java - Take For Loop Variables And Put Into 2 Separate Array
4.Program to create multiplication table
public class multiplicationTable
{
public static void main(String args[]){System.out.print(" ");
for (int i=1; i<=9; i++)System.out.print(" "+i);System.out.println();
System.out.println("-------------------------------------------------------");
for (int i=1; i<=9; i++){System.out.print(i+"|");
for (int j=1; j<=9; j++){if (i*j<10)System.out.print(" "+i*j);
elseSystem.out.print(" "+i*j);}System.out.println();
}}}