A directory of Objective Type Questions covering all the Computer Science subjects. Here you can access and discuss Multiple choice questions and answers for various compitative exams and interviews.

41. Which of these values are returns under the case of normal termination of a program?
a. 0
b. 1
c. 2
d. 3
View Answer Report Discuss Too Difficult!
Answer: (a).0

42. 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);
         }
    }
a. 0
b. 1
c. 1000
d. System Dependent
View Answer Report Discuss Too Difficult!
Answer: (d).System Dependent

43. 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));
        }
    }
a. ABCDEF ABCDEF
b. ABCDEF GHIJKL
c. GHIJKL ABCDEF
d. GHIJKL GHIJKL
View Answer Report Discuss Too Difficult!
Answer: (a).ABCDEF ABCDEF

44. Which of these is a super class of wrappers Double and Float?
a. Long
b. Digits
c. Float
d. Number
View Answer Report Discuss Too Difficult!
Answer: (d).Number

45. Which of the following methods return the value as a double?
a. doubleValue()
b. converDouble()
c. getDouble()
d. getDoubleValue()
View Answer Report Discuss Too Difficult!
Answer: (a).doubleValue()

46. Which of these methods can be used to check whether the given value is a number or not?
a. isNaN()
b. isNumber()
c. checkNaN()
d. checkNumber()
View Answer Report Discuss Too Difficult!
Answer: (a).isNaN()

47. Which of these method of Double wrapper can be used to check whether a given value is infinite or not?
a. Infinite()
b. isInfinite()
c. checkInfinite()
d. None of the mentioned
View Answer Report Discuss Too Difficult!
Answer: (b).isInfinite()

48. Which of these exceptions is thrown by compareTo() method defined in a double wrapper?
a. IOException
b. SystemException
c. CastException
d. ClassCastException
View Answer Report Discuss Too Difficult!
Answer: (d).ClassCastException

49. 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);
        }
    }
a. true
b. false
c. 0
d. 1
View Answer Report Discuss Too Difficult!
Answer: (b).false

50. 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);
        }
    }
a. 0
b. 1
c. 256
d. 257
View Answer Report Discuss Too Difficult!
Answer: (d).257

Page 5 of 22