Any javafags here?
I'm trying to create an anonymous class to override a method of an object created by a method return, not from "new Object();"
e.g
>InputStream is = new Socket().getInputStream();
not
>InputStream is = new InputStream();
(Im aware InputStream is abstract, its just an example)
How do I do that?
Bump
Please help
Been coding in Java for 2 years, don't know what you're asking
>>334567
class whateverThingyWrapper{
public static InputStream getWrappedInputStream() {
return new Socket().getInputStream();}}
>https://en.wikipedia.org/wiki/Factory_method_pattern#Java