title: ClassCastException: Unable to type cast object type into socket
body: <p>I'm trying to convert object type into socket type, so that I can use the properties of socket to get port number of particular node, which is present in my linked list. But I'm getting a class cast exception when I try the below code. I had also tried to convert Node type into Socket, which gave me an error, hence I'm trying to convert Object type into Socket type. Any assistance will be of great help.</p>
  
  <pre><code>    for(int i=0;i&lt;7;i++)
              {
                  Socket t;
                  Object obj;
                  obj = Node.List1.get(2);
                  t=(Socket) obj;
                  int p=t.get Port();
                }  
  </code></pre>