hi,everyone!
I meet some truble when I studying I/O and threads.I'm very appreciate if you can give me some good advice.
1)A file stored on local disk is to be read one line at a time into
String objects,which constructions would be the mst suitable for reading the file?
A.FileInputStream in=new FileInputStream("file.name");
B.DataInputStream in=new DataInputStream(new FileInputStream("file.name"));
C.DataInputStream in=new DataInputStream(new FileInputStream("file.name","r"));
D.BufferedReader in=new BufferedReader(new FileInputStreamReader(new FileInputStream("file.name")));
E.BufferedReader in=new BufferedReader(new InputStreamReader(new FileInputStream("file.name"),"8859_1"))
2)which statemens about threads are true?
A.Uncoordinated changes to shared data by multiple threads may result in the data being read,or left,
in an inconsistent state.
B.The
Java interpreter's natural exit occurs when no non-daemon threads remain alive ;
C.Threads created from the same class all finish together.
3)FilterInputStream is the parent class for BufferedInputStream,DataInputStream
and LineNumberInputStream.Which classes,individually,are valid as an argument
for the constructor of FilterInputStream?
A.FileInputStream
B.FileOutputStream
c.File
D.RandomAccessFile
E.PrintStream
thank you!