Java - MCQ

Multiple Choice Questions


Share with a Friend

 

Java MCQ - Introduction to Java - Set 15

71. If an expression contains double, int, float, long, then the whole expression will be promoted into which of these data types?
A). long
B). int
C). double
D). float
View Answer
Correct: C



72. What will be the output of the following Java code?

    class char_increment 
    {
        public static void main(String args[]) 
        {
            char c1 = 'D';
            char c2 = 84;
            c2++;
            c1++;
            System.out.println(c1 + " "  + c2);
        } 
    }
A). E U
B). U E
C). V E
D). U F
View Answer
Correct: A



73. Java is a ........... language.
A). weakly typed
B). strongly typed
C). moderate typed
D). None of these
View Answer
Correct: B



74. How many primitive data types are there in Java?
A). 6
B). 7
C). 8
D). 9
View Answer
Correct: C



75. Size of int in Java is
A). 16 bit
B). 32 bit
C). 64 bit
D). Depends on execution environment
View Answer
Correct: B



 
 
 
   
   
   
UltraInfo Technologies
ITDeveloper