File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Array Declaration Doubt

 
Jayant Raj
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Please refer to the following code :



Q. Why is there a compile time exception at 2 ?
Q. Is a5 a 1-D array & a6 a 2-D array ?
 
Sebastien Col
Greenhorn
Posts: 13
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Q. Why is there a compile time exception at 2 ?
R. Because of the [] that is before the a4 identifier. The first part of the line says that you're declaring int arrays, the first one being named "a3". Then, after the coma, you must have only identifiers, as following:

int []a3, a4;

Q. Is a5 a 1-D array & a6 a 2-D array ?
R. Yes. a5 is an int[], and a6 is an array of int[].

Sebastien.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic