<< The Next Big Thing: An Opinionated Google Search | Home | Something's Going On In The XML World >>

Friday Java Quiz: Trivia Time

  • Q: How many methods does java.lang.Object have? How many of them are native?
  • Q: How many interfaces does the java.lang package contain? How many of them are marker interfaces?
  • Q: How many immediate subpackages are there under java? How many of them can be safely thrown away?
  • Q: Have you ever used the class java.util.Scanner in production code? (I know you blogged about it. That doesn't count.)

Rules: You won't need the compiler to answer these questions. For the first three questions, write down your guess before you check the API documentation.

Tags :


Re: Friday Java Quiz: Trivia Time

Gee, how many lines of code does java.lang.String have? How many bytes of memory does HelloWorld consume? How often does James Gosling shave? How many anonymous classes are in the javax.swing.event package?

Re: Friday Java Quiz: Trivia Time

I think Object has 3 not naive methods - toString, equals and getClass. Rest of them are naive and should be deprecated. I think java.lang has no interfaces, however java.io has many interfeces and interfaces for those interfaces. java.lang, java.io, java.text(I think), java.sql, java.nio, java.concurrency(it should be if its not), java.util(almost forgot this one:P). rest should be throw away and java.io too. The Scanner question is the best :D I'm not Swing developer, so no. However I do think that Swing masters do it old school, just like io>nio(all the schools teach io).

Re: Friday Java Quiz: Trivia Time

Is this a joke? I see it's tagged "humor"...
Anyway:

1. Let's see:

  • equals (not native, I think)
  • hashCode (native)
  • getClass (native)
  • clone (native)
  • toString (native)
  • wait (native)
  • notify (native)
  • notifyAll (native)
It seems to me I'm forgetting something, but I can't imagine what.
2. Cloneable is the only one I can think of, and it's a marker.
3. What raveman said (but I wouldn't throw away java.io yet).
4. Never made it out of testing (replaced it with a much faster ad-hoc parser).

:D

java.text.Annotation :D Now i understand when people say that they dont use Annotation :P java.util.XMLUtils(default axxess) looks funny, do people at sun say that java xml api sucks? :D I wonder how many hidden treasures you can find in JDK :)

Add a comment Send a TrackBack