adplus-dvertising

Welcome to the java lang and java io MCQs Page

Dive deep into the fascinating world of java lang and java io with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of java lang and java io, a crucial aspect of Java Programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of java lang and java io, 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 java lang and java io. 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 java lang and java io. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

java lang and java io MCQs | Page 8 of 26

Explore more Topics under Java Programming

Q71.
Which of these class is used to read characters in a file?
Discuss
Answer: (a).FileReader
Q72.
Which of these method of FileReader class is used to read characters from a file?
Discuss
Answer: (a).read()
Q73.
Which of these class can be used to implement the input stream that uses a character array as the source?
Discuss
Answer: (c).CharArrayReader
Q74.
Which of these classes can return more than one character to be returned to input stream?
Discuss
Answer: (c).PushbachReader
Q75.
What is the output of this program?
    import java.io.*;
    class Chararrayinput 
    {
        public static void main(String[] args) 
        {
     String obj  = "abcdef";
            int length = obj.length();
            char c[] = new char[length];
            obj.getChars(0,length,c,0);
            CharArrayReader input1 = new CharArrayReader(c);
            CharArrayReader input2 = new CharArrayReader(c, 0, 3);
            int i;
            try 
            {
  while ((i = input1.read()) != -1) 
                {
                    System.out.print((char)i);
                }
            } 
            catch (IOException e) 
            {
         // TODO Auto-generated catch block
                e.printStackTrace();
     }
 }
    }
Discuss
Answer: (d).abcdef
Q76.
What is the output of this program?
    import java.io.*;
    class Chararrayinput 
    {
        public static void main(String[] args) 
        {
     String obj  = "abcdef";
            int length = obj.length();
            char c[] = new char[length];
            obj.getChars(0, length, c, 0);
            CharArrayReader input1 = new CharArrayReader(c);
            CharArrayReader input2 = new CharArrayReader(c, 0, 3);
            int i;
            try 
            {
  while ((i = input2.read()) != -1) 
                {
                    System.out.print((char)i);
                }
            } 
            catch (IOException e) 
            {
         // TODO Auto-generated catch block
                e.printStackTrace();
     }
 }
    }
Discuss
Answer: (a).abc
Q77.
What is the output of this program?
    import java.io.*;
    class Chararrayinput 
    {
        public static void main(String[] args) 
        {
     String obj  = "abcdefgh";
            int length = obj.length();
            char c[] = new char[length];
            obj.getChars(0, length, c, 0);
            CharArrayReader input1 = new CharArrayReader(c);
            CharArrayReader input2 = new CharArrayReader(c, 1, 4);
            int i;
            int j;
            try 
            {
  while ((i = input1.read()) == (j = input2.read())) 
                {
                    System.out.print((char)i);
                }
            } 
            catch (IOException e) 
            {
         // TODO Auto-generated catch block
                e.printStackTrace();
     }
 }
    }
Discuss
Answer: (d).None of the mentioned
Q78.
Which of the following is not a segment of memory in java?
Discuss
Answer: (d).Register Segment
Q79.
Does code Segment loads the java code?
Discuss
Answer: (a).True
Discuss
Answer: (b).Interpreter

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!