File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Multidimensional arrays Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply locked New topic
Author

Multidimensional arrays

Shweta R Dhaneshwar
Ranch Hand

Joined: May 27, 2005
Posts: 35
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?


Shweta Dhaneshwar.<br />SCJP 1.4 90%
Faris A Saduli
Ranch Hand

Joined: Feb 22, 2005
Posts: 58
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
Marshal

Joined: Jul 08, 2003
Posts: 24184
    
  34

Please continue this discussion here.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multidimensional arrays