I have just started doing a practice exam. This is one of the questions:
Assuming in and out are properly defined and instantiated InputStream and OutputStream objects, respectively, which are true statements about the following code snippet? (Choose all that apply.)
Answer is
The code does not compile because the offset parameter is missing on line 5..... If the method signature on line 5 was changed to out.write(buffer,0,lengthRead), then the code would compile and run without issue
If we are supposed to know the exact signature for this method, why not for every method in the InputStream class. And if for every method in the IS class, why not for every method in OutputStream. And then, why not every method in BOS, BIS, FOS, FIS, Writer, Reader, BW, BR, FileWriter, FileReader, PrintStream, PrintWriter, , OOS, and OIS?
And then, for every class in the Collections API.
And then, for every class in java.util.concurrent.
And then, for every class in Files, every
String method, every StringBuilder method.
Hmmph.