adplus-dvertising
frame-decoration

Question

What is the output of this 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!='\'');
        }
    }

a.

abc’

b.

abcdef/’

c.

abc’def/’egh

d.

abcqfghq

Posted under Java Programming

Answer: (a).abc’

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program if input given is “abc’def/’egh”?

Similar Questions

Discover Related MCQs

Q. Which exception is thrown by read() method?

Q. Which of these is used to read a string from the input stream?

Q. Which of these class is used to read characters and strings in Java from console?

Q. Which of these class is implemented by FilterInputStream class?

Q. Which of these class contains the methods print() & println()?

Q. Which of these methods can be used to writing console output?

Q. Which of these classes are used by character streams output operations?

Q. Which of these class is used to read from a file?

Q. Which of these class contains the methods used to write in a file?

Q. Which of these exception is thrown in cases when the file specified for writing is not found?

Q. Which of these methods are used to read in from file?

Q. Which of these values is returned by read() method is end of file (EOF) is encountered?

Q. Which of these exception is thrown by close() and read() methods?

Q. Which of these methods is used to write() into a file?

Q. Which of these functions is called to display the output of an applet?

Q. Which of these methods can be used to output a string in an applet?

Q. Which of these methods is a part of Abstract Window Toolkit (AWT) ?

Q. Which of these modifiers can be used for a variable so that it can be accessed from any thread or parts of a program?

Q. Which of these operators can be used to get run time information about an object?

Q. An applet is a Java class that extends the