Search code examples
javaabstractfunction-declaration

Difference between two Java function declarations


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.


Solution

  • To answer the original question too, abstract is not part of the return type, it's a modifier of the method itself, just like public. The return types of the two methods are identical.