I have used 2d arrays many times before, but for some reason eclipse keeps putting a red line under ; at the end of the declaration line for it. When I run it I get an unresolved compilation error. Here is my code:

private Zone[][] zones = new Zone[10][10];

What is going on here?

Recommended Answers

All 5 Replies

What compiler errors do you get when you try to compile the program?
Try using the javac command to compile the program and see what error messages it gives.

Exception in thread "main" java.lang.Error: Unresolved compilation problem:

Hover the mouse over the red line to see the compiler error message.

I've been seeing a lot of problems with OPs using IDEs that are not giving good/full text error messages lately. When I use the javac command to compile these programs I get better error messages than the OP is getting from his IDE. Is the problem that the OPs do not have some options turned on that would give the better error message or that they don't know how to use the IDE (hover the cursor over ...)

Agree. Eclipse and NetBeans are tools for more experienced users only - beginners just get more confused.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.