| Author |
scjp (DataInputStream)
|
Sham Grandhe
Ranch Hand
Joined: Dec 16, 2003
Posts: 73
|
|
54. Which of the following will compile without error? A) File f = new File("/","autoexec.bat"); B) DataInputStream d = new DataInputStream(System.in); C) OutputStreamWriter o = new OutputStreamWriter(System.out); D) RandomAccessFile r = new RandomAccessFile("OutFile"); can a datainputstream take the system.in as an parameter, the datainputstream is high level, so it needs lowlevel stream, plz make this clear shyam [ Jess added a more descriptive title ] [ January 22, 2004: Message edited by: Jessica Sant ]
|
 |
Ray Stojonic
Ranch Hand
Joined: Aug 08, 2003
Posts: 326
|
|
A DataInputStream is constructed with an InputStream object. System.in is a BufferedInputStream, which extends FilterInputStream, which extends InputStream. Therefore, System.in 'is-a' InputStream and can be used as a constructor argument for DataInputStream.
|
 |
Sham Grandhe
Ranch Hand
Joined: Dec 16, 2003
Posts: 73
|
|
hai Ray Stojonic, thank you fr the kind information, I've been given the exact informaion that Ineed.
|
 |
 |
|
|
subject: scjp (DataInputStream)
|
|
|