wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes doubt in kathy sierra question? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "doubt in kathy sierra question?" Watch "doubt in kathy sierra question?" New topic
Author

doubt in kathy sierra question?

Hennry Smith
Greenhorn

Joined: Jan 21, 2011
Posts: 26


What is true?
A. One of them will compile, only one will be true
B. Two of them will compile, only one will be true
C. Two of them will compile, two will be true
D. Three of them will compile, only one will be true
E. Three of them will compile, exactly two will be true
F. Three of them will compile, exactly three will be true

Actual answer:
Answer:
D is correct. Fragments F2, F3, and F5 will compile, and only F3 is true.

A, B, C, E, and F are incorrect. F1 is incorrect because you can’t compare a primitive to
an array. F4 is incorrect syntax to access an element of a two-dimensional array.

please explain each of this in detail....i am confused in array...
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3068
    
  33

I would suggest you have a look at the Array Tutorials.

f2- Is an Array of Arrays of float values. So f2[0] would actually return an Array float values. f2[0][0] would actually return an float value.
f3- Its just an array of float values.

Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubt in kathy sierra question?
 
Similar Threads
Comparison of arrays
Compiling errata for K&B, SCJP 6
operator flow
operator
Quw from KB book, chap 4 -> test Q 3