Author Topic:   Boone 1.1 Mock #40
Eric Barnhill
ranch hand
posted May 05, 2000 11:01 PM         
Question:

Construct an array of 3 String objects containing the strings "a", "b", "c", using the {} notation. Call the string by the variable name s.

Answer:

String s = {"a","b","c"};

shouldn't there be an indication of an array somewhere? I get a compiler error with this. My answer was String[] s = {"a","b","c"};

Eric

Ashish Thakur
greenhorn
posted May 05, 2000 11:11 PM             
In my opinion ur answer is fine.
when u said :
shouldn't there be an indication of an array somewhere? I get a compiler error with this. My answer was String[] s = {"a","b","c"};

the "this" meant the previous code right?, cause ur code will not have a problem unless u try to declare it within a method.

Also the question is quite out of line when it says

"Call the string by the variable name s" it should have said,
"Call the array by the variable name s" or
"Call the string array by the variable name s"

Anybody has any other opinion??


Eric Barnhill
ranch hand
posted May 05, 2000 11:42 PM         
Yes, I did mean the previous code but it wasn't clear. Thanks for the reply.

Eric

maha anna
bartender
posted May 07, 2000 02:37 PM             
Eric,
I also seen this qstn somewhere while I was preparing for the exam. But I don't remember what the author said. Where is this qstn from. We can move to Errata.
regds
maha anna

Eric Barnhill
ranch hand
posted May 07, 2000 10:11 PM         
I took it here but I don't think this is the official place for it.

Eric

maha anna
bartender
posted May 08, 2000 07:14 AM             
Ok. This post is all set to go to our Errata Forum. Thanks Eric.
regds
maha anna

|