This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Grokking Bitcoin and have Kalle Rosenbaum on-line!
See this thread for details.
Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Another error in SCJP5 quiz by muppeteer?  RSS feed

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

there is a question in the quiz:



and possible answers:

a) ab666
b) ab
c) doesn't compile

right answer given: c.

But the code compiles (with warnings but still compile!!!). It just throws an exception at runtime because String and Integer are not mutually comparable.

And another case. There is a piece of code without a question and you have to choose 1, 2, 3, 4:




regards

Serg
 
Java Cowboy
Posts: 16084
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a link to where we can find that test? Try sending a message to the author of the test.
 
Serg Masow
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The questions above are from a SCJP5 quiz included in Java.Inquisition, which can be found here:
http://enigma.vm.bytemark.co.uk/webstart.html
 
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can contact Matt Russel. He manages the mock exams on his application
 
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
import java.util.Set;
import java.util.TreeSet;
public class Testing123
{
public static void main(String... args)
{
Set t = new TreeSet();
t.add("a");
t.add("b");
t.add("666");
for(Object o:t)
System.out.print(o);
}
}

output : 666ab

Can any one expalin me why its showing as 666ab, it should show ab666.
 
Serg Masow
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

because in this example TreeSet uses the natural order for sorting of it's elements and digits are "lesser" as letters.

regards
Serg
 
Why does your bag say "bombs"? The reason I ask is that my bag says "tiny ads" and it has stuff like this:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!