Menu

Objective Type Questions & Answers


Java Programming Objective Type Questions-Part-2



1. Java method overloading implements the OOPS concept ___.

A . Inheritance

B . Polymorphism

C . Encapsulation

D . None

Answer



2. ___ is the superclass to all Java classes either user-defined or built-in.

A . Class

B . Object

C . Superclass

D . Null

Answer



3. Java language doesn`t supports ___ type of inheritance.

A . Multiple Inheritance

B . Multi-Level Inheritance

C . Single Inheritance

D . Hierarchical Inheritance

Answer



4. If you use "import packagename.* ", which of the following will be acc

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

Answer



5. Which access modifier data members will be accessible Inside the package only.

A . public

B . default

C . private

D . protected

Answer



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

Answer



7. Which access modifier data members will be accessible Inside the class only.

A . public

B . default

C . private

D . protected

Answer



8. Which of the method is not supported by scanner class?

A . nextLine()

B . readLine()

C . nextInt()

D . None of the above

Answer



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

Answer



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

Answer



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

Answer



12. The wrapping up of data and functions into a single unit is called

A . Encapsulation

B . Abstraction

C . Data Hiding

D . Polymorphism

Answer



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

Answer



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

Answer



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

Answer



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

Answer



17. The compile time polymorphism performed by _______________________?

A . method overloading

B . method overriding

C . both method overloading and overriding

D . none of the above

Answer



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

Answer



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

Answer



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.

Answer



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

Answer



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

Answer



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

Answer



24. ___________ binding will be performed at runtime when we override the methods.

A . Dynamic

B . Static

C . Both

D . None of the above

Answer



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

Answer





Relevant Materials :

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 ]


Similar Materials :

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 ]

Cyber Forensics Objective Type Question Bank-Part-2 - [ Cyber Forensics ]

Cyber Forensics Objective Type Question Bank-Part-1 - [ Cyber Forensics ]

Neural Networks and Deep Learning-Unit-1 Objective Type Questions - [ NNDL ]

Neural Networks and Deep Learning-Unit-2 Objective Type Questions - [ NNDL ]

Neural Networks and Deep Learning-Unit-3 Objective Type Questions - [ NNDL ]

Neural Networks and Deep Learning-Unit-4 Objective Type Questions - [ NNDL ]

Operating Systems -Unit-1 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-2 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-3 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-4 Objective Type Questions - [ Operating Systems ]

Operating Systems -Unit-5 Objective Type Questions - [ Operating Systems ]

Web Technologies -Unit-1 (PHP) Objective Type Questions - [ Web Technologies ]

Web Technologies -Unit-2 (XML) Objective Type Questions - [ Web Technologies ]

Web Technologies -Unit-3 (Servlets) Objective Type Questions - [ Web Technologies ]

Web Technologies -Unit-4 (JSP) Objective Type Questions - [ Web Technologies ]