What is the function of these basic lines in java ?

throws ioexception

inputstreamreader read = new inputstreamreader(system.in)

buffered reader in = new bufferedreader read;

1 Answer

  • Chris
    Lv 7
    7 years ago

    The first one tells Java that the following code might encounter an error when it comes to input or output (could be reading a file, or from the keyboard, etc.)

    The second part wraps the console input in reader classes which allows you to read discrete values (numbers, text) as opposed to just a stream of bytes.

Still have questions? Get answers by asking now.