wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes array problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "array problem" Watch "array problem" New topic
Author

array problem

Venkata Raaman
Ranch Hand

Joined: Mar 26, 2010
Posts: 45

What is wrong with my code why am I getting warning..

Tom Reilly
Rancher

Joined: Jun 01, 2010
Posts: 618
You cannot just put a statement like my2Darr[0]= new int[3]; in a class. You have to put it in a method, constructor, or block of code. To see this, the easiest thing to do is put the statement in a code block as in:
Sunny Bhandari
Ranch Hand

Joined: Dec 06, 2010
Posts: 448

or make the array variable as static and move the erroneous code to main method.


Java Experience
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: array problem
 
Similar Threads
A Quadrilateral extend program
What is wrong with my code?
Autoboxing, checking is two objects refer to the same object
method overloading and passed arguments
array issues