Ken Hanks

Greenhorn
+ Follow
since Mar 04, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ken Hanks

I'm trying to figure out how the "accept" method of ServerSocket just sits there and blocks. In looking at it, I noticed that "accept" creates a Socket ref var with this code: Socket s = new Socket((SocketImpl) null);
The question is, does this mean that a null reference variable, cast to type SocketImpl, is being passed to the Socket constructor? If so, I have to wonder why they did it that way....
Thanks, Ernest and Bill, for your answers and information. Sometimes, late at night, I lose common sense. I've since worked out a lot of examples in JBuilder and it's all making a lot more sense now. Thanks again!
18 years ago
Mr. Brogen, in Chapter 3, test question 10 -- I have a real problem with your answer on that one. You've implicitly cast a Long object to an Object. Everything I've read says that when you do this, you only have access to the methods in the item on the left, the "larger domain". The Object domain implements "equals" as a simple "=="; it checks to see if two objects are "the same", NOT if they have the same contents. Since you didn't state that there was an overridden implementation of 'equals' in the Long object, I have to assume it uses the one in Object. Therefore the statement at line 5 ( if (A.equals(L)) would yield false and your answer is wrong. Please let me know your thinking on this. I hope that the answer does not indicate that I'm supposed to know the implementation of every class in the API by heart, including Long.
18 years ago