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 5 of 26

Q41.
Which of these values are returns under the case of normal termination of a program?

a.

0

b.

1

c.

2

d.

3

Discuss
Answer: (a).0
Q42.
What is the output of this program?
    import java.lang.System;
    class Output
    {
         public static void main(String args[])
         {
             long start, end;   
             start = System.currentTimeMillis();
             for (int i = 0; i < 10000000; i++);
             end = System.currentTimeMillis();
             System.out.print(end - start);
         }
    }
Discuss
Answer: (d).System Dependent
Q43.
What is the output of this program?
    import java.lang.System;
    class Output 
    {
        public static void main(String args[])
        {
            byte a[] = { 65, 66, 67, 68, 69, 70 };
            byte b[] = { 71, 72, 73, 74, 75, 76 };  
            System.arraycopy(a, 0, b, 0, a.length);
            System.out.print(new String(a) + " " + new String(b));
        }
    }
Discuss
Answer: (a).ABCDEF ABCDEF
Q44.
Which of these is a super class of wrappers Double and Float?
Discuss
Answer: (d).Number
Q45.
Which of the following methods return the value as a double?
Discuss
Answer: (a).doubleValue()
Q46.
Which of these methods can be used to check whether the given value is a number or not?
Discuss
Answer: (a).isNaN()
Q47.
Which of these method of Double wrapper can be used to check whether a given value is infinite or not?
Discuss
Answer: (b).isInfinite()
Q48.
Which of these exceptions is thrown by compareTo() method defined in a double wrapper?
Discuss
Answer: (d).ClassCastException
Q49.
What is the output of this program?
    class Output 
    {
        public static void main(String args[])
        {
            Double i = new Double(257.5);  
            boolean x = i.isNaN();
            System.out.print(x);
        }
    }
Discuss
Answer: (b).false
Q50.
What is the output of this program?
    class Output
    {
        public static void main(String args[])
        {
            Double i = new Double(257.578);  
            int x = i.intValue();
            System.out.print(x);
        }
    }
Discuss
Answer: (d).257
Page 5 of 26

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!