Object Oriented Programming - I (3140705) MCQs

MCQs of Introduction to java and elementary programming

Showing 51 to 60 out of 95 Questions
51.
What is the extension of compiled java classes?
(a) .class
(b) .java
(c) .txt
(d) .js
Answer:

Option (a)

52.
What is the range of short data type in Java?
(a) -128 to 127
(b) -32768 to 32767
(c) -2147483648 to 2147483647
(d) None of the mentioned
Answer:

Option (b)

53.
What is the range of byte data type in Java?
(a) -128 to 127
(b) -32768 to 32767
(c) -2147483648 to 2147483647
(d) None of the mentioned
Answer:

Option (a)

54.
Which of the following are legal lines of Java code?
   1. int w = (int)888.8;
   2. byte x = (byte)100L;
   3. long y = (byte)100;
   4. byte z = (byte)100L;
(a) 1 and 2
(b) 2 and 3
(c) 3 and 4
(d) All statements are correct
Answer:

Option (d)

55.
An expression involving byte, int, and literal numbers is promoted to which of these?
(a) int
(b) long
(c) byte
(d) float
Answer:

Option (a)

56.
Which of these literals can be contained in float data type variable?
(a) -1.7e+308
(b) -3.4e+038
(c) +1.7e+308
(d) -3.4e+050
Answer:

Option (b)

57.
What will be the output of the following Java statement?
class output {
        public static void main(String args[]) 
        {
            double a, b,c;
            a = 3.0/0;
            b = 0/4.0;
            c=0/0.0;
 
	    System.out.println(a);
            System.out.println(b);
            System.out.println(c);
        } 
    }
(a) Infinity
(b) 0.0
(c) NaN
(d) all of the mentioned
Answer:

Option (d)

58.
What is the numerical range of a char data type in Java?
(a) -128 to 127
(b) 0 to 256
(c) 0 to 32767
(d) 0 to 65535
Answer:

Option (d)

59.
Which of these coding types is used for data type characters in Java?
(a) ASCII
(b) ISO-LATIN-1
(c) UNICODE
(d) None of the mentioned
Answer:

Option (c)

60.
Which of these values can a boolean variable contain?
(a) True & False
(b) 0 & 1
(c) Any integer value
(d) true
Answer:

Option (a)

Showing 51 to 60 out of 95 Questions