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.
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:
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).
Anyway:
1. Let's see:
- equals (not native, I think)
- hashCode (native)
- getClass (native)
- clone (native)
- toString (native)
- wait (native)
- notify (native)
- notifyAll (native)
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).