Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Boone 1.1 Mock #40

 
Eric Barnhill
Rancher
Posts: 233
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 233
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, I did mean the previous code but it wasn't clear. Thanks for the reply.
Eric
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 233
Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I took it here but I don't think this is the official place for it.
Eric
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok. This post is all set to go to our Errata Forum. Thanks Eric.
regds
maha anna
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic