According to the docs, it returns an InputStream. But also according to the docs, InputStream is an abstract class. So which particular subclass does .openStream() return?
1 Answer
The point of encapsulation is that you don't know or care.
You just use it as an InputStream, and whatever it returns will behave as you expect.
It could even return a different class on Sundays if it wanted to, and you still wouldn't know or care.
Reading the source, it looks like HTTP URLs return an instance of an internal class called HttpInputStream.
.getClass()on the stream returned to find out.