File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 46

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