Online GK Series

This site is dedicated to the aspirants of competitive exams SSC, UPSC, Railways, Postal Assistants, Bank, GATE and NET

Objects and Classes - Java MCQs with Answers

Questions
1 Which of the following is an invalid declaration for the main method in java program?
A public static void main (String [ ] args)
B public static strictfp void main(String args[ ])
C final static public void main (String args[ ])
D All are Correct

Answer: Option [D]
2 A top level class may have which one of the following access modifiers?
A package
B private
C protected
D public

Answer: Option [D]
3 Visualizing program components as objects is characteristics of which of the following language types?
A Object-oriented programming language
B Machine language
C Command line operating system
D Procedural language

Answer: Option [A]
4 A subclass is also called as
A inner class
B nested class
C derived class
D hidden class

Answer: Option [C]
5 Attribute of an object can include information about
A State
B Method
C Behavior
D Procedures

Answer: Option [A]

Computer Science Books

Chapters

Please Like Us
Brand