ExamVeda
Login
Home
51
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
52
Which of these class contains the methods print() & println()?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
53
Which of these methods can be used to writing console output?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
54
Which of these classes are used by character streams output operations?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
55
Which of these class is used to read from a file?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
56
What will be the output of the following Java program?
class output
{
    public static void main(String args[])
    {
        String a="hello i love java";
        System.out.println(indexof('i')+" "+indexof('o')+" "+lastIndexof('i')+" "+lastIndexof('o') ));
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
57
What will be the output of the following Java program?
class output
{
    public static void main(String args[])
    {
        char c[]={'a','1','b',' ','A','0'];
        for (int i = 0; i < 5; ++i)
        {
      if(Character.isDigit(c[i]))
                System.out.println(c[i]" is a digit");
            if(Character.isWhitespace(c[i]))
               System.out.println(c[i]" is a Whitespace character");
            if(Character.isUpperCase(c[i]))
               System.out.println(c[i]" is an Upper case Letter");
            if(Character.isUpperCase(c[i]))
               System.out.println(c[i]" is a lower case Letter");
            i = i + 3;
        }
    }
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
58
What will be the output of the following Java program?
class output
{
    public static void main(String args[])
    { 
       StringBuffer s1 = new StringBuffer("Hello");
       StringBuffer s2 = s1.reverse();
       System.out.println(s2);
    }
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
59
Which of these class contains the methods used to write in a file?
Discuss
Answer & Solution
Answer: Option C
Solution:
The class BufferedOutputStream in Java contains methods that are used to write data into a file. It provides buffering for output streams, which helps to improve efficiency by reducing the number of write operations to the underlying file.
60
Which of these exception is thrown in cases when the file specified for writing is not found?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board