ExamVeda
Login
Home
41
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');
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
42
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!='\'');
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
43
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());
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
44
Which exception is thrown by read() method?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
Which of these is used to read a string from the input stream?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
46
Which of these class is used to read characters and strings in Java from console?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
Which of these class is implemented by FilterInputStream class?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
48
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"));
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
49
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);
    }
}
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
50
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);
    }
}
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board