Question 1 of 25
Hints left: 3
Q1
What will be the output of the following Java program if input given is "abc'def/'egh"? class Input_Output { public static void main(String args[]) throws IOException { char c; BufferedReader obj = new BufferedReader(new InputStreamReader(System.in)); do { c = (char) obj.read(); System.out.print(c); } while(c!='\''); } }
Q2
What will be the output of the following Java program? class output { public static void main(String args[]) { StringBuffer c = new StringBuffer("Hello"); StringBuffer c1 = new StringBuffer(" World"); c.append(c1); System.out.println(c); } }
Q3
Which exception is thrown by read() method?
Q4
Which of these classes are used by Byte streams for input and output operation?
Q5
Which of these class contains the methods print() & println()?
Q6
What will be the output of the following Java program? class output { public static void main(String args[]) { StringBuffer c = new StringBuffer("Hello"); System.out.println(c.length()); } }
Q7
When comparing java.io.BufferedWriter and java.io.FileWriter, which capability exist as a method in only one of two ?
Q8
System class is defined in .................
Q9
What will be the output of the following Java program if input given is 'abcqfghqbcd'? class Input_Output { public static void main(String args[]) throws IOException { char c; BufferedReader obj = new BufferedReader(new InputStreamReader(System.in)); do { c = (char) obj.read(); System.out.print(c); } while(c != 'q'); } }
Q10
What will be the output of the following Java program? class output { public static void main(String args[]) { StringBuffer s1 = new StringBuffer("Hello"); s1.setCharAt(1,x); System.out.println(s1); } }
Q11
Which of these is used to perform all input & output operations in Java?
Q12
Which of these classes are used by character streams for input and output operations?
Q13
What will be the output of the following Java program if input given is "abc'def/'egh"? class Input_Output { public static void main(String args[]) throws IOException { char c; BufferedReader obj = new BufferedReader(new InputStreamReader(System.in)); do { c = (char) obj.read(); System.out.print(c); } while(c != '\''); } }
Q14
Which of these is a type of stream in Java?
Q15
Which of these class is used to read from byte array?
Q16
Which of these class is used to read characters and strings in Java from console?
Q17
What will be the output of the following Java program if input given is "Hello stop World"? class Input_Output { public static void main(String args[]) throws IOException { string str; BufferedReader obj = new BufferedReader(new InputStreamReader(System.in)); do { str = (char) obj.readLine(); System.out.print(str); } while(!str.equals("strong")); } }
Q18
Which of these class is implemented by FilterInputStream class?
Q19
Which of these classes are used by character streams output operations?
Q20
Which of these is used to read a string from the input stream?
Q21
Which of these classes defined in java.io and used for file-handling are abstract? A. InputStream B. PrintStream C. Reader D. FileInputStream E. FileWriter
Q22
What does AWT stands for?
Q23
What is the purpose of the `Console` class in Java?
Q24
Which of these methods can be used to writing console output?
Q25
try{ File f = new File("a.txt"); }catch(Exception e){ }catch(IOException io){ } Is this code create new file name a.txt ?