adplus-dvertising

Welcome to the IO and Applets MCQs Page

Dive deep into the fascinating world of IO and Applets with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of IO and Applets, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of IO and Applets, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within Java Programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through IO and Applets. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of Java Programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of IO and Applets. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

IO and Applets MCQs | Page 2 of 6

Q11.
Which of these class is used to read characters and strings in Java from console?
Discuss
Answer: (a).BufferedReader
Q12.
Which of these class is implemented by FilterInputStream class?
Discuss
Answer: (a).InputStream
Q13.
What is the output of this 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: (d).Hello stop World
Q14.
What is the output of this 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: (d).Hello World
Q15.
Which of these class contains the methods print() & println()?
Discuss
Answer: (d).PrintStream
Q16.
Which of these methods can be used to writing console output?
Discuss
Answer: (d).all of the mentioned
Q17.
Which of these classes are used by character streams output operations?
Discuss
Answer: (b).Writer
Q18.
Which of these class is used to read from a file?
Discuss
Answer: (c).FileInputStream
Q19.
What is the output of this 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: (a).6 4 6 9
Q20.
What is the output of this 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: (a). a is a lower case Letter
is White space character
Page 2 of 6

Suggested Topics

Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!