Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extending the Socket class

Status
Not open for further replies.

netooi25

Programmer
Jul 30, 2004
25
US
Hi, I got the idea I would extend the Socket class
and provide a few more useful methods to it for my
program...

I am having a problem though.

When I call the accept method of the ServerSocket class,
It returns a Socket object instead of the subclass object.

It compiles but this is causing a classcastexception when I try to run it in a test program. Can anyone tell me how I can assign the return value of the ServerSocket's accept method to my subclass of the Socket class? Is this possible.

Thanks
 
You've posted this here and the Java forum. Please don't cross-post.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top