[2D Array] Initialization problem

My problem is that I’m trying to make a 2D Array of tiles for my Raycasting engine but I keep getting that stupid error. (cannont define dimension expressions when you have an initializer) Is there anyway around this error. Or am I going about this way wrong?

:emo: Remove the stuff in the brackets. You can’t define a dimension when you are initializing it with explicit data.

Yes but I want the array to be 24 by 24 or does that not matter?

If you want it to be 24 x 24 then you just put in data that is 24 x 24.

[/offtopic], how did you get eclipse’s background that color? [/ontopic]
Nothing to report here, longarmx beat me to it.

Its really easy. Just google how to get eclipse dark UI.

Code example to help solidify what’s already been said.

int[][] worldMap = new int[][] {
				{1, 2, 3, 4, 5},
				{5, 4, 3, 2, 1}
		};
		
		for(int i = 0; i < worldMap.length; i++) {
			for(int j = 0; j < worldMap[i].length; j++) {
				System.out.println(worldMap[i][j]);
			}
		}

Prints out

[quote]1
2
3
4
5
5
4
3
2
1
[/quote]

Thanks, when I tried to change it, I looked in the settings, and could only find text color settings, so I figured it wasn’t possible.

I use color theme (Wombat option) and Moonrise plugins. They can both be easily found on the Eclipse Marketplace.

Full Size

I got moonrise, with the rainbow drops theme. Looks much better now :wink: Thanks for the info!