Top 250+ Solved Java Programming MCQ Questions Answer

From 106 to 120 of 285

Q. Which concept of Java is a way of converting real world objects in terms of class?

a. Polymorphism

b. Encapsulation

c. Abstraction

d. Inheritance

  • c. Abstraction

Q. How can we identify whether a compilation unit is class or interface from a .class file?

a. Java source file header

b. Extension of compilation unit

c. We cannot differentiate between class and interface

d. The class or interface name should be postfixed with unit type

  • a. Java source file header

Q. Which of these packages contains abstract keyword?

a. javlang

b. java.util

c. java.io

d. java.system

  • a. java.lang

Q. Which of these class is used to create an object whose character sequence is mutable?

a. String()

b. StringBuffer()

c. String() & StringBuffer()

d. None of the mentioned

  • b. StringBuffer()

Q. Which of these method of class StringBuffer is used to find the length of current charactersequence?

a. length()

b. Length()

c. capacity()

d. Capacity()

  • a. length()

Q. Which of these method(s) is/are used for writing bytes to an outputstream?

a. put()

b. print() and write()

c. printf()

d. write() and read()

  • b. print() and write()

Q. Which keyword is used by the method to refer to the object that invoked it?

a. import

b. catch

c. abstract

d. this

  • d. this

Q. What is the return type of a method that does not return any value?

a. int

b. float

c. void

d. double

  • c. void

Q. Which of these selection statements test only for equality?

a. if

b. switch

c. if & switch

d. none of the mentioned

  • b. switch

Q. Which of these is the method which is executed first before execution of any other thing takesplace in a program?

a. main method

b. finalize method

c. static method

d. private method

  • c. static method

Q. Which of these data type can be used for a method having a return statement in it?

a. void

b. int

c. float

d. both int and float

  • d. both int and float
Subscribe Now

Get All Updates & News