posted 22 years ago
hi
1:Connected to a socket s, read one line of ASCII char. Please construct the right input method:
- InputStream in = new InputStream(s.getInputStream());
- DataInputStream in = new DataInputStream(s.getInputStream());
- BufferedReader in = new BufferedReader(InputStreamReader(s.getInputStream());
- BufferedReader in = new BufferedReader(InputStreamReader(s.getInputStream(), "8859_1");
Use socket method. "in" is an InputStream constructed by "InputStream in = new Socket().getInputStream();"
2: Which constructor is the most adequate for transmition of ASCII data from the socket?
- BufferedReader(InputStreamReader(in, "8859_1")) // his choice
- BufferedReader(InputStreamReader(in))
- DataInputStream(in)
- BufferedInputStream(DataInputStream(in))
- InputStreamReader(in)
3:You want to use the readLine() method which of the following will be the correct initialization?
a) BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream("file","8859_1")))
b) BufferedReader bf = new BufferedReader(new InputStreamReader(new FileInputStream("file")))
c) DataInputStream ds = new DataInputStream(new FileInputStream("file"))
4:What kind of Stream does DataInputStream accept?
what are the valid type of arguments for different types of streams & readers/writers...
can anybody ans these question.i am totally confused when i get these type of questions...
can anybody help with this..(any notes on this topic)so that i can read..& be ready for the exam..
thanx
sherinn