I want to find the contents of the java.net.ServerSocket
accept()
method (because I am trying to override it so it returns a different type). Is this possible in Eclipse, or for that matter, in Java?
Thanks.
I want to find the contents of the java.net.ServerSocket
accept()
method (because I am trying to override it so it returns a different type). Is this possible in Eclipse, or for that matter, in Java?
Thanks.
No, it isn't possible in Java. Because, you can not modify the return type of a function you override. The Java Tutorials Overriding and Hiding Methods says (in part)
An instance method in a subclass with the same signature (name, plus the number and the type of its parameters) and return type as an instance method in the superclass overrides the superclass's method.
I recommend you use the @Override
annotation to protect yourself from acidentally overloading a method you intend to override.