This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ARRAYS

 
Abdul Latif
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following are legal array declarations. Select all correct answers.
a) int i[5][];
b) int i[][];
c) int []i[];
d) int i[5][5];
e) int[][] a;
The ans says its b,c,e but i am not able to understand why c?
 
Fei Ng
Ranch Hand
Posts: 1245
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think that just the way of the array syntax.
correct me if i am wrong.
 
Ragu Sivaraman
Ranch Hand
Posts: 464
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Abdul Latif:
Which of the following are legal array declarations. Select all correct answers.
a) int i[5][];
b) int i[][];
c) int []i[];
d) int i[5][5];
e) int[][] a;
The ans says its b,c,e but i am not able to understand why c?

yep c is ok.. It just that the way it is....
Ragu
 
Mr Iftikhar
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi latif.
Yes latif int []a[] declaration of array is another style in JLS.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic