Java I/O Streams and String Handling
Tests knowledge of Java I/O Stream classes (InputStream, OutputStream, Reader, Writer) and String class methods and operations.
Questions
The stream class can be categorized into how many groups depending upon the data on which they operate?
- 5
- 4
- 3
- 2
- None of these
Which of the following methods are defined in OutputStream class?
- flush()
- write(byte[ ] b)
- write(byte[ ] b , int offset, int len) :-
- Both 1 and 3
- All of these
Which of the following methods are defined in InputStream class of Bytes Stream?
- read(byte[ ] b)
- mark(int limit)
- read()
- Both 1 and 3
- All of these
How many subclasses of OutputStream Class are present in java?
- 9
- 6
- 5
- 8
- 7
Which of the following are the subclasses of OutputStream Class?
- ObjectOutputStream
- PipedOutputStream
- ByteOutputStream
- Both 1 and 2
- All of these
How many subclasses are there of InputStream Class?
- 9
- 7
- 8
- 6
- 5
Character Stream class is defined by using _____ class hierarchy?
- 7
- 5
- 2
- 4
- None of these
Byte stream are defined by using _____ class hierarchy?
- 4
- 3
- 2
- 1
- None of these
How many subclasses of Reader Class are there in Java?
- 9
- 8
- 7
- 6
- 5
Which of the following methods are defined in Reader class?
- skip(long)
- mark(int limit)
- reset()
- Both 1 and 3
- All of these
Which of the following is/are not the subclasses of Reader class?
- StringReader
- PipeReader
- InputReader
- Both 1 and 2
- Both 1 and 3
Which of the following is /are not the subclasses of Writer class in java?
- CharWriter
- StringWriter
- BufferedWriter
- Both 1 and 2
- Both 1 and 3
Which of the following are the subclasses of InputStream Class?
- StringBufferedInputStream
- FilterInputStream
- SequenceInputStream
- Both 2 and 3
- All of these
Which of the following methods is/are defined in the File class in Java?
- getPath()
- getName()
- length()
- Both 1 and 2
- All of these
How many subclasses of Writer class are there in Java?
- 7
- 6
- 8
- 9
- 5
What will be the result of the above code?
String s = �Welcome To Java�;
s.charAt(s.length());
- a
- v
- Compiler Error : canoot pass a function as parameter
- Compiler Error : parameters not sufficient
- Compiler Error : parameters not sufficient
Which of the following methods are defined in the String class for comparing the Strings?
- equals(String s)
- compareToIgnoreCase(String s1)
- compareTo(String s3)
- Both 2 and 3
- All of these
What will be the result of the above code?
String s = �Welcome To Java�
s.substring(4 , 3 );
- ome
- - 1
- com
- Run time error
- Compile time error
Which of the following functions cannot be invoked using the object of String class?
- toLower()
- trim()
- split()
- Both 1 and 3
- Both 2 and 3
What will be the output of the given piece of code?
String s = �Welcome To Java�;
String s1 = �Java�;
s.match(s1);
- true
- false
- - 1
- Compile time error
- Run time error