Typecasting of "Object" object into "Socket" object
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, February 4, 2008 02:11 AM

1. Vector list = new Vector();
2. Socket c,j;
3. Object o;
4. list.addElement(c);
5. o = list.elementAt(1);
6. j = (Socket) o;

I want to know whether typecasting in statement-5 is correct or not.
If not then how can I convert a variable of "Object" datatype into a variable of "Socket" datatype.

About | Sitemap | Contact