C Programming Multiple Choice Questions (MCQ) | IT Developer <?php echo $page_title; ?>
IT Developer

Java Programming Multiple Choice Questions (MCQ)

Introduction to Java - Multiple Choice Questions (MCQ) - Set 8



Share with a Friend

Multiple Choice Questions


Java - Introduction to Java - Multiple Choice Questions (MCQ) - Set 8

36. What is the correct signature of main method?
A). public void main()
B). static void main()
C). public static void main(String[] args)
D). void main(String args)
View Answer
Correct: C

 


Explanation
main Method Signature : public static void main(String[] args) is required for JVM to start execution.

 


37. Java programs are:
A). Only compiled
B). Only interpreted
C). Both compiled and interpreted
D). None
View Answer
Correct: C

 

 

Explanation
Hybrid Nature : Java is both compiled (to bytecode) and interpreted (by JVM).

 

 

38. Which feature allows Java to run on different platforms?
A). Encapsulation
B). Bytecode
C). Inheritance
D). Overloading
View Answer
Correct: B

 


Explanation
Bytecode Feature : Bytecode allows the same code to run on different platforms.

 


39. Java is strongly typed means:
A). Variables must be declared with type
B). No data types required
C). Types are optional
D). Only integers allowed
View Answer
Correct: A

 

 

Explanation
Strongly Typed :
Variables must be declared with a specific data type.

 

 


40. Which keyword is used to define a class?
A). define
B). class
C). object
D). struct
View Answer
Correct: B

 


Explanation
class Keyword : The class keyword defines a class in Java.