According to the Java docs for Socket the socket has an instance of a class called SocketImpl.
However if you look at that class it clearly states that SocketImpl is an abstract class.
As far i know you cannot have an instance of an abstract class! could anyone tell me what is going on here?
Link: Socket Java Docs
Qoute from Docs:
The actual work of the socket is performed by an instance of the SocketImpl class.
Link to SocketImpl class: SocketImpl
The actual concrete object is an instance of a class which extends
SocketImpl:And since inheritance defines an is a relationship, any instance of ConcreteSocketImpl is a SocketImpl.
That’s a fundamental principle of object orientation. If you couldn’t have any instance of an abstract class, abstract classes and interfaces would make no sense at all, and would be completely useless.