• 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Arrays  RSS feed

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can anybody help me by explaining the following.
byte[ ] A[ ],B;
byte[ ][ ] C[ ][ ],D[ ][ ];
Which of these will cause an Error?
P) A=B;
Q) B=C;
R)C=D;
S)Both P and Q;
T)Both R and S;
 
Ranch Hand
Posts: 1070
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Without testing it, I would think the answer would be T, all of them cause an error.
A is a two dimension array of bytes A[][]
B is a one dimenison array of bytes B[]
C is a four dimension array of bytes C[][][][]
D is a two dimesion array of bytes D[][]
So the only assignment that I think is legal would be A to D or vice versa. That isn't one of your choices, so I think they are all illegal.
Also, I am moving this to the certification forum for more comments.
Bill
 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
I think D is byte[][][][] too.
So only C=D; ir the right answer.

Originally posted by bill bozeman:
Without testing it, I would think the answer would be T, all of them cause an error.
A is a two dimension array of bytes A[][]
B is a one dimenison array of bytes B[]
C is a four dimension array of bytes C[][][][]
D is a two dimesion array of bytes D[][]
So the only assignment that I think is legal would be A to D or vice versa. That isn't one of your choices, so I think they are all illegal.
Also, I am moving this to the certification forum for more comments.
Bill



[This message has been edited by ego hu (edited March 26, 2001).]
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So is S the correct answer ?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Gaurav Mantro:
So is S the correct answer ?


Yes.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!