Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Multidimensional arrays  RSS feed

 
Shweta R Dhaneshwar
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Report post to moderator
Given the following,

which of the following lines of code could be inserted at line 7, and still allow the code to
compile? (Choose four that would work.)
A. b2[0][1] = b;
B. b[0][0] = b3;
C. b2[1][1][0] = b[0][0];
D. b2[1][2][0] = b;
E. b2[0][1][0][0] = b[0][0];
F. b2[0][1] = big;

This example is from K&B.is there any easy way to solve such a problem.this is confusing...can anybody explain?
 
Faris A Saduli
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Report post to moderator
hi,
the following thing 'll compile
b[0][0] = b3;
b2[0][1] = b;
b2[0][1][0][0] = b[0][0];
b2[0][1] = big;
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please continue this discussion here.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!