I understand how the Multidimensional Arrays are built.
My question is about this: Line 22
months = years[1];
What happens here?
What is the value of years[1]?
And any additional information that will help me understand multidimensional arrays
Thanks
public class ArrayStuff
{
public byte[] b;
public int i[];
public ArrayStuff[][] testme;
float years[][];
float months[];
ArrayStuff()
{
years = new float[3][4];
months = new float[3];
years[1][1] = 2000;
months[1] = 1;
months[2] = 2;
months[2] = years[1][3];
months[1] = years[2][2];
months = years[1];//I need help understanding
System.out.println(months[3]);
float f = 3;
months[(int)f] = 2;
}
public static void main(
String args[])
{
ArrayStuff arrayStuff = new ArrayStuff();
System.out.println("Joe Sample " + arrayStuff.months[3]);
System.out.println("Smooth Jazz " + arrayStuff.years[1][3]);
}
}