top of page
  • Facebook
  • Twitter
  • Instagram

Placement Preparation Questions

Placement Preparation questions are free resources offered by mobiprep that can help you ace any company placement process. We have curated a list of the most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement preparation questions also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.

Q

41

Which of these method is given parameter via command line arguments?

a.

main()

b.

Recursive()method

c.

Any method

d.

None of the above

Correct Answer & Explanation:

a

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

Q

42

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

a.

java.lang

b.

java.util

c.

java.io

d.

java.system

Correct Answer & Explanation:

a

java.lang contains the Stack Overflow in Java.

Q

43

What is the use if interpreter?

a.

They convert bitecode to machine code.

b.

They read high level code and execute them.

c.

They are intermediated between JIT and JVM.

d.

It is a synonym of JIT.

Correct Answer & Explanation:

b

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

Q

44

Which of these handles the exception when no catch is used?

a.

Default handler

b.

Finally

c.

Throw Handler

d.

Java Runtime System

Correct Answer & Explanation:

a

Q

45

What exception throw by parseInt() method?

a.

ArithmeticExecption

b.

ClassNotFoundExecption

c.

NullPointerExecption

d.

NumberFormatExecption

Correct Answer & Explanation:

d

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

Q

46

What is the premise of equality for IdentityHashMap?

a.

Reference Equality

b.

Name equality

c.

Hashcode equality

d.

Length equality

Correct Answer & Explanation:

a

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

Q

47

How to sort elements of Arraylist?

a.

Collection.sort(listObj);

b.

Collections.sort(listObj);

c.

listObj.sort();

d.

Sorter.sortAsc(listObj);

Correct Answer & Explanation:

b

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

Q

48

Which of these method of Object class is used to obtain class of an object at run time?

a.

get()

b.

void getclass()

c.

Class getclass()

d.

None of the mentioned

Correct Answer & Explanation:

c

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

bottom of page