• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Majji exam

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which of the following are valid array declarations/definitions?
1: int iArray1[10];
2: int iArray2[];
3: int iArray3[] = new int[10];
4: int iArray4[10] = new int[10];
5: int []iArray5 = new int[10];
6: int iArray6[] = new int[];
7: int iArray7[] = null;
A) 1.
B) 2.
C) 3.
D) 4.
E) 5.
F) 6.
G) 7.
The Ans given is b,c,e,g.But i choose b,c,g.e is invalid since
no dimension for array is specified which results in compiler error.
Thanks!
 
Dd R
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
E is the fifth line and it has dimension on the right hand side and it is correct. so no wrong with the majji's answer.
thanks,
dd
Originally posted by avn:
Which of the following are valid array declarations/definitions?
1: int iArray1[10];
2: int iArray2[];
3: int iArray3[] = new int[10];
4: int iArray4[10] = new int[10];
5: int []iArray5 = new int[10];
6: int iArray6[] = new int[];
7: int iArray7[] = null;
A) 1.
B) 2.
C) 3.
D) 4.
E) 5.
F) 6.
G) 7.
The Ans given is b,c,e,g.But i choose b,c,g.e is invalid since
no dimension for array is specified which results in compiler error.
Thanks!

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic