I was reading Hadoop documentation when I came across two function declarations returning a reference to an abstract class:
public FSDataInputStream open(Path f) throws IOException
public abstract FSDataInputStream open(Path f, int bufferSize) throws IOException
Apart from differences in the parameters, why do these two functions have different return type, one explicitly declared abstract while other not?
Thanks.
To answer the original question too,
abstractis not part of the return type, it’s a modifier of the method itself, just likepublic. The return types of the two methods are identical.