top of page
  • Facebook
  • Twitter
  • Instagram

Top 40 Java Placement MCQ Questions and Answers

  • May 21, 2022
  • 1 min read

Updated: Oct 15, 2022

Java is an adaptable language, letting developers to build programmes that would run on any system, independent of architecture or platform. According to the Java home page, Java is used by over 1 billion PCs and 3 billion mobile phones globally. Top Tech companies including Amazon, Twitter uses Java in its back- end. Getting a good grasp of top Java Placement MCQ Questions will surely provide you an edge in cracking such top companies.


Top Java Placement MCQ Questions PDF

Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important Java MCQ questions with detailed explanations to ensure the best placement preparation.






These top Java Placement questions have been segmented into three sections:

Basic Java Placement Questions






Intermediate Java Placement Questions

Q 16. What is the output of a Bitwise AND (&) operation if one of the inputs/operands is 0?

  • 0

  • 1

  • 0 or 1

  • None of the above

Correct Answer & Explanation: a

Because (0 & anything) is always equal to 0.

Correct Answer & Explanation: d

We can write any number of ELSE-IF statements in a Java program.

Correct Answer & Explanation: c

AWT stands for Abstract Window Toolkit, it is used by applets to interact with the user.

Correct Answer & Explanation: a

It uses correct array declaration and correct array construction, while others generate a compile error.

Correct Answer & Explanation: a

Switch statements are based on integer expressions and since both bytes and chars can implicitly be widened to an integer, these can also be used. Short is wrapper class and reference types can not be used as variables.

Correct Answer & Explanation: b

The char type is integral but unsigned. The range of a variable of type char is from 0 to 65535. Java characters are Unicode, which is a 16-bit encoding capable of representing a wide range of international characters.

Correct Answer & Explanation: a

Correct Answer & Explanation: c

There are two ways to remove an object from ArrayList. We can use overloaded method remove(int index) or remove(Object obj). We can also use as an iterator to remove the object.

Correct Answer & Explanation: c

”throw” keyword is used for throwing exception manually in java program. User defined exceptions can be thrown too.

Correct Answer & Explanation: c

JIT optimizes bytecode to machine specific language code by compiling similar bytecodes at same time. This reduces overall time taken for compilation of bytecode to machine specific language.

Correct Answer & Explanation: c

random() is a static method defined in Math class. Syntax: static double random() random() always returns a value in the range 0.0 1 to 1.99 that will be '1' when typecasted to int. not selected.

Correct Answer & Explanation: c

The word "signed" is not a valid modifier keyword in the Java language. All number primitives in Java are signed. Hence the Compilation will fail.

Correct Answer & Explanation: a

i & iv because only start() and run() are defined by the Thread class.

Correct Answer & Explanation: b

Because a method-local inner class can be abstract, although it means a subclass of the inner class must be created if the abstract class is to be used (so an abstract method-local inner class is probably not useful).

Correct Answer & Explanation: d

To disallow a method from being overridden specify final as a modifier at the start of its declaration.



Advance Java Placement Questions


Q 31. which of these class is super class of every class in java?

  • String

  • Object

  • Abstract

  • Array list

Correct Answer & Explanation: b

Object class is super class of every class in Java.

Correct Answer & Explanation: a

Unary not operator ~ inverts all of the bits of its operant in binary representation.

Correct Answer & Explanation:b

Correct Answer & Explanation: a

Order of precedence is (Highest to lowest) A> B > C > D

Correct Answer & Explanation: d

Throwable is built in class and all exception type are subclass of this class.

Correct Answer & Explanation: b

Correct Answer & Explanation:c

There are two types of multitasking: Process based multitasking and thread based multitasking.

Correct Answer & Explanation: b

Daemon thread runs in the background and does not prevent JVM from terminating

Correct Answer & Explanation: d

The value at the 0th position will be assigned to the variable first.

Correct Answer & Explanation: c

Variables of an interface are public, static and final by default because the interface cannot be instantiated.

Correct Answer & Explanation: a

Only main() method can be given parameters via using command line arguments.

Correct Answer & Explanation: a

java.lang contains the Stack Overflow in Java.

Correct Answer & Explanation: b

They read high level language and execute the program. Interpreters are normally not passing through bitecode and JIT compilation.

Correct Answer & Explanation: a

Correct Answer & Explanation: d

parseInt()Method parses input into integer. The exception thrown by this method is number format exception.

Correct Answer & Explanation: a

IdentityHashMap is rarely used as it violates the basic contact of implementing equals() and HashCode method().

Correct Answer & Explanation: b

Collections provide a method to sort the list. The order of sorting can be defined using Comparator.

Correct Answer & Explanation: c

Class getclass() is used to obtain class of an object at run time.





These Java interview questions would give you an insight into what kind of questions could be asked.


Comments


bottom of page