Menu

Objective Type Questions & Answers


Java Programming Objective Type Question Bank



1.Who invented Java Programming?

A . Guido van Rossum

B . James Gosling

C . Dennis Ritchie

D . Bjarne Stroustrup

Answer



2.Which component is used to compile, debug and execute the java programs?

A . JRE

B . JIT

C . JDK

D . JVM

Answer



3.Which one of the following is not a Java feature?

A . Object-oriented

B . Use of pointers

C . Portable

D . Dynamic and Extensible

Answer



4.Which of these cannot be used for a variable name in Java?

A . identifier & keyword

B . identifier

C . keyword

D . none of the mentioned

Answer



5.Which of the following is a type of polymorphism in Java Programming?

A . Multiple polymorphism

B . Compile time polymorphism

C . Multilevel polymorphism

D . Execution time polymorphism

Answer



6.Which of these are selection statements in Java?

A . break

B . continue

C . for()

D . if()

Answer



7.Which of the following is a superclass of every class in Java?

A . ArrayList

B . Abstract class

C . Object class

D . String

Answer



8.Which one of the following is not an access modifier?

A . Protected

B . Void

C . Public

D . Private

Answer



9.What is the numerical range of a char data type in Java?

A . 0 to 256

B . -128 to 127

C . 0 to 65535

D . 0 to 32767

Answer



10.In which process, a local variable has the same name as one of the instance variables?

A . Serialization

B . Variable Shadowing

C . Abstraction

D . Multi-threading

Answer



11.What do you mean by nameless objects?

A . An object created by using the new keyword.

B . An object of a superclass created in the subclass.

C . An object without having any name but having a reference.

D . An object that has no reference.

Answer



12.Which option is false about the final keyword?

A . A final method cannot be overridden in its subclasses.

B . A final class cannot be extended.

C . A final class cannot extend other classes.

D . A final method can be inherited.

Answer



13.In which memory a String is stored, when we create a string using new operator?

A . Stack

B . String memory

C . Heap memory

D . Random storage space

Answer



14.Which of the given methods are of Object class?

A . notify(), wait( long msecs ), and synchronized()

B . wait( long msecs ), interrupt(), and notifyAll()

C . notify(), notifyAll(), and wait()

D . sleep( long msecs ), wait(), and notify()

Answer



15.What is the initial quantity of the ArrayList list?

A . 5

B . 10

C . 0

D . 100

Answer



16.What is meant by the classes and objects that dependents on each other?

A . Tight Coupling

B . Cohesion

C . Loose Coupling

D . None of the above

Answer



17.Which of this keyword must be used to inherit a class?

A . super

B . this

C . extent

D . extends

Answer



18.A class member declared protected becomes a member of subclass of which type?

A . public member

B . private member

C . protected member

D . static member

Answer



19.Which of these is correct way of inheriting class A by class B?

A . class B + class A {}

B . class B inherits class A {}

C . class B extends A {}

D . class B extends class A {}

Answer



20.Which of these keyword is used to refer to member of base class from a sub class?

A . upper

B . super

C . this

D . none

Answer



21.Which inheritance in java programming is not supported?

A . Multiple inheritance using classes

B . Multiple inheritance using interfaces

C . Multilevel inheritance

D . Single inheritance

Answer



22.Which of these keywords can be used to prevent inheritance of a class?

A . super

B . constant

C . class

D . final

Answer



23.Which of these class relies upon its subclasses for complete implementation of its methods?

A . Object class

B . abstract class

C . ArrayList class

D . None of the mentioned

Answer



24.Properties are implemented using ___ in Java.

A . Methods

B . Variables

C . Interfaces

D . All the above

Answer



25.Creating an object from a class is also called ____.

A . Initializing

B . Instantiating

C . Interfacing

D . None of the above

Answer



26.An object is created at __ time in Java.

A . Compile-time

B . Run time

C . Assembling time

D . None of the above

Answer



27.Which of the following statements is a valid declaration of an object that belongs to "MyClass"?

A . MyClass obj = new MyClass();

B . MyClass obj = new MyClass;

C . obj = new MyClass();

D . new MyClass obj;

Answer



28.Which of these operators is used to allocate memory for an object?

A . malloc

B . alloc

C . new

D . realloc

Answer



29.____________________ is the address of the memory location where the object is stored

A . Memory

B . Variable

C . Reference

D . None

Answer



30.There is a special portion of memory called the _____________ where the object lives.

A . Heap

B . Pile

C . Stack

D . All of these

Answer



31.When an object is created, in addition of allocating memory, a special method called ________________ is executed to perform initial task.

A . Function

B . Constructor

C . Class

D . Method

Answer



32.Every ________________ has it`s own set of data

A . Class

B . Variable

C . Operator

D . Object

Answer



33.Java has a garbage collector that looks for unused _____________ and reclaims the memory that those objects are using.

A . Objects

B . Variables

C . Cells

D . Memory spaces

Answer



34.Protection of data is possible with the use of access __________________

A . Modifiers

B . Operators

C . Methods

D . None of these

Answer



35._____________________ variables can be accessed without creating an instance of a class

A . public

B . new

C . static

D . private

Answer



36.Object-oriented programming languages provides reusability feature using _____________

A . polymorphism

B . Abstraction

C . Inheritance

D . Encapsulation

Answer



37.Inheritance models __________________ relationship between two classes.

A . is-a

B . its-a

C . has-a

D . is-at

Answer



38.___________________ refers more than one method having same name but different parameters?

A . Method overloading

B . Method overriding

C . Duplicate methods

D . All

Answer



39.___________________ members are available as `private` members in the inherited sub class

A . public

B . private

C . protected

D . default

Answer



40.___________________ variables are variables defined within a class but outside any method.

A . Instance

B . Private

C . Local

D . Global

Answer



41.Which of these jump statements can skip processing the remainder of the code in its body for a particular iteration?

A . break

B . return

C . exit

D . continue

Answer



42.Which of the following is not a decision making statement?

A . if

B . if-else

C . switch

D . do-while

Answer



43.Which of these class is superclass of String and StringBuffer class?

A . java.util

B . java.lang

C . ArrayList

D . None of the mentioned

Answer



44.Which of this method of class String is used to obtain a length of String object?

A . get()

B . Sizeof()

C . lengthof()

D . length()

Answer



45.Which of these method of class String is used to extract a single character from a String object?

A . CHARAT()

B . chatat()

C . charAt()

D . ChatAt()

Answer



46.Which of these constructors is used to create an empty String object?

A . String()

B . String(void)

C . String(0)

D . None of the mentioned

Answer



47.Which of these method of class String is used to compare two String objects for their equality?

A . equals()

B . Equals()

C . isequal()

D . Isequal()

Answer



48.Which feature comes under compile time polymorphism?

A . Method overloading

B . Constructor overloading

C . Method overriding

D . Both A and B

Answer



49.Final keyword in java is used with

A . class

B . class fields

C . class methods

D . All of the above

Answer



50.Which of these keywords can be used to prevent Method overriding?

A . static

B . constant

C . protected

D . final

Answer



51.Which of these keywords is used to define interfaces in Java?

A . intf

B . Intf

C . interface

D . Interface

Answer



52.Which of these packages contains the exception Stack Overflow in Java?

A . java.io

B . java.system

C . java.lang

D . java.util

Answer



53.An interface with no fields or methods is known as a ______.

A . Runnable Interface

B . Marker Interface

C . Abstract Interface

D . CharSequence Interface

Answer



54.Which keyword is used for accessing the features of a package?

A . package

B . import

C . extends

D . export

Answer



55.Correct statement about a class and interface is/are

A . An interface can extend multiple interfaces

B . A class can implement multiple interfaces.

C . Java support multiple inheritance using interfaces.

D . All of the above.

Answer



56.Which of the following is the correct way of importing an entire package ‘pkg’?

A . import pkg.

B . Import pkg.

C . import pkg.*

D . Import pkg.*

Answer



57.Which of the following package stores all the standard java classes?

A . lang

B . java

C . util

D . java.packages

Answer



58.Which of these access specifiers can be used for an interface?

A . Public

B . Protected

C . private

D . All of the mentioned

Answer



59.What kind of methods does an interface contain by default?

A . abstract

B . static

C . final

D . private

Answer



60.A Java static method can not be ___.

A . private or protected

B . final

C . abstract

D . All the above

Answer



61.Package in Java is a mechanism to encapsulate a ______________.

A . Classes

B . Sub Packages

C . Interfaces

D . All of the above

Answer



62.Packages that are inside another package are the _________

A . packages

B . nested packages

C . util subpackages

D . subpackages

Answer



63.Which one is correct declaration for implementing two interfaces?

A . class C implements A, B

B . class C implements A, implements B

C . class C implements A extends B

D . class C implements A.B

Answer



64. ………… Environment variable identifies the location of Java compiler?

A . CLASSPATH

B . PATH

C . JAVAPATH

D . COMPILERPATH

Answer



65. PATH environment variable can be set using ______ .

A . Command line

B . Control panel

C . Both A and B

D . Java compiler

Answer



66. How to display value of PATH environment variable at command line?

A . PATH

B . Set PATH

C . Show PATH

D . Display PATH

Answer



67. PATH environment variable identifies the location of ______

A . Java compiler

B . Java interpreter

C . Java tools

D . All 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 :

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 ]