• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • Devaka Cooray
Saloon Keepers:
  • Ganesh Patekar
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • salvin francis
Bartenders:
  • Ron McLeod
  • Frits Walraven
  • Pete Letkeman

Majji exam  RSS feed

 
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!
 
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!


 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!