pals i just wanna ask if anyone could show me how to declare and call a 2d array?
thanks in advance!!!
Piece of cake
int a[][] = new int[2][4]; Define and SetSize
You can google many example on 2D Array. Like http://leepoint.net/notes-java/data/arrays/arrays-2D.html
You can also pre-populate the 2D array upon creation.
int a[][] = { {1, 2, 3, 4}, {5, 6, 7, 8} };
int len_1 = a.length; -- len_1 would be 2
int len_2 = a[0].length; -- len_2 would be 4
int len_3 = a[1].length; -- len_3 would also be 4
call a 2d array?
Can you explain what you mean by "call"? Arrays contain data, not methods.
They could contain object references to classes that have methods that could be called:
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.