1. Java method overloading implements the OOPS concept ___.
A . Inheritance
B . Polymorphism
C . Encapsulation
D . None
2. ___ is the superclass to all Java classes either user-defined or built-in.
A . Class
B . Object
C . Superclass
D . Null
3. Java language doesn`t supports ___ type of inheritance.
A . Multiple Inheritance
B . Multi-Level Inheritance
C . Single Inheritance
D . Hierarchical Inheritance
4. If you use "import packagename.* ", which of the following will be accessible.
A . All the classes and interfaces of this package and subpackages
B . All the classes and interfaces of this package
C . Only classes of this package
D . None
5. Which access modifier data members will be accessible Inside the package only.
A . public
B . default
C . private
D . protected
6. Which access modifier data members will be accessible Inside the package and outside the package through sub classes.
A . public
B . default
C . private
D . protected
7. Which access modifier data members will be accessible Inside the class only.
A . public
B . default
C . private
D . protected
8. Which of the method is not supported by scanner class?
A . nextLine()
B . readLine()
C . nextInt()
D . None of the above
9. What is the correct syntax to create to an object for Console class?
A . Console c = new Console();
B . Console c = new Console(System.in);
C . Console c = System.console();
D . None of above
10. Constructor is a special type of method which is used to ______________________?
A . initialize the object
B . provide default values to an object
C . provide different values to distinct objects
D . All the above
11. Which of the following is not a standard rule to define constructor?
A . Constructor name must be same as it`s Class name
B . Constructor must have explict return type
C . Constructor must have no explict return type
D . None of the above
12. The wrapping up of data and functions into a single unit is called
A . Encapsulation
B . Abstraction
C . Data Hiding
D . Polymorphism
13. In object-oriented programming, new classes can be defined by extending existing classes. This is an example of:
A . Encapsulation
B . Interface
C . Composition
D . Inheritance
14. What is the maximum number of ELSE-IF statements that can present in between starting IF and ending ELSE statements?
A . 32
B . 64
C . 128
D . None
15. The super keyword is used to ____________________.
A . access the variables in parent class
B . access the variables in child class
C . access the methods in parent class
D . access the variables and methods in parent class
16. Which of the following statement is invalid about final keyword?
A . The final keyword can be appiled on classes to prevent inheritance
B . The final keyword can be appiled on methods to disallow method overridding
C . The final keyword can be appiled on methods to disallow method overloading
D . The final keyword can be appiled on variables to declare constants
17. The compile time polymorphism performed by _______________________?
A . method overloading
B . method overriding
C . both method overloading and overriding
D . none of the above
18. If a class have multiple methods with same name but different parameters is known as _________________?
A . method overloading
B . method overriding
C . constructor overloading
D . none of the above
19. If a child class has the same method as declared in the parent class is known as _________________?
A . method overloading
B . method overriding
C . constructor overloading
D . none of the above
20. Which of the following is not a rule for method overriding?
A . Methods must have same name
B . Methods must have same method parameters
C . IS-A relationship between child and parent class
D . Class name and method name must be same.
21. For a Multi Level Inheritance which of the following is correct?
A . Class-C inherits from Class-A and Class-B inherits from Class-C
B . Class-C inherits from Class-A and Class-B
C . Class-B inherits from Class-A and Class-B inherits from Class-A
D . None of the above
22. To stop or block inheriting a given class, the ___ keyword is used before the class.
A . static
B . private
C . final
D . none of the above
23. An Overridden method is the method of ____ class and the overriding method is the method of ___ class.
A . super, sub
B . sub, super
C . super, super
D . sub, sub
24. ___________ binding will be performed at runtime when we override the methods.
A . Dynamic
B . Static
C . Both
D . None of the above
25. An abstract class can have __________________________?
A . Only abstract methods.
B . Only non abstract methods.
C . Abstract and non abstract methods.
D . None of the above
☞ Java Programming Objective Type Question Bank - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-1 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-2 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-3 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-4 - [ Java Programming ]
☞ Java Programming Objective Type Questions-Part-5 - [ Java Programming ]
☞ R - Programming MCQs - Unit-1 - [ R-Programming ]
☞ R - Programming MCQs - Unit-2 - [ R-Programming ]
☞ R - Programming MCQs - Unit-3 - [ R-Programming ]
☞ R - Programming MCQs - Unit-4 - [ R-Programming ]
☞ R - Programming MCQs - Unit-5 - [ R-Programming ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-1 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-2 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-3 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-4 - [ FLAT ]
☞ Formal Languages and Automata Theory (FLAT) MCQs - Unit-5 - [ FLAT ]
☞ PPS MCQs - Unit-1 - [ PPS ]
☞ PPS MCQs - Unit-2 - [ PPS ]
☞ PPS MCQs - Unit-3 - [ PPS ]
☞ PPS MCQs - Unit-4 - [ PPS ]
☞ PPS MCQs - Unit-5 - [ PPS ]
☞ Object Oriented Programming through Java MCQs - Unit-1 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-2 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-3 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-4 - [ OOP_JAVA ]
☞ Object Oriented Programming through Java MCQs - Unit-5 - [ OOP_JAVA ]
☞ Design and Analysis of Algorithms MCQs - Unit-1 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-2 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-3 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-4 - [ DAA ]
☞ Design and Analysis of Algorithms MCQs - Unit-5 - [ DAA ]
☞ Software Engineering MCQs - Unit-1 - [ SE ]
☞ Software Engineering MCQs - Unit-2 - [ SE ]
☞ Software Engineering MCQs - Unit-3 - [ SE ]
☞ Software Engineering MCQs - Unit-4 - [ SE ]
☞ Software Engineering MCQs - Unit-5 - [ SE ]
☞ Data Mining MCQs - Unit-1 - [ DM ]
☞ Data Mining MCQs - Unit-2 - [ DM ]
☞ Data Mining MCQs - Unit-3 - [ DM ]
☞ Data Mining MCQs - Unit-4 - [ DM ]
☞ Data Mining MCQs - Unit-5 - [ DM ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-1 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-2 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-3 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-4 - [ COA ]
☞ Computer Organization and Architecture (COA) Objective Question Bank-Unit-5 - [ COA ]
☞ Data Structures Objective Type Question Bank-Unit-1 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-2 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-3 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-4 - [ DS ]
☞ Data Structures Objective Type Question Bank-Unit-5 - [ DS ]
☞ Database Management System Objective Type Question Bank-Unit-1 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-2 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-3 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-4 - [ DBMS ]
☞ Database Management System Objective Type Question Bank-Unit-5 - [ DBMS ]