Abstract class InputStream
says that subclasses need to implement method read()
which reads one byte
and then turns it into an unsigned int
.
System.in
is an InputStream
and I can do:
int i = System.in.read();
My question is.. where is this method implemented? How come it works? Maybe an odd question but I'm trying to find out what's happening under the hood and since I'm using an object of class InputStream and not one of its subclasses, I'm wondering where the actual method is implemented and why it works...