OOP in JAVA MCQ BCA Third Semester 2023

BCA Nepal

OOP in JAVA BCA Third Semester 2023

i. Which of the following is not primitive data type defined in Java?

a) Byte

b) long

c) Boolean

d) String.

ii. Which of the following is not valid declaration of for loop?

a) for(int a=7;a<=77;a+=7)

b) for(int a=99;a>=0;a/9)

c) for(int a=2;a<=20;a=2*a)

d) for(int a-20;a-2; –a)

iii. What is process by which one object acquires all the properties and behaviors of another object?

a) Inheritance

b) Polymorphism

c) Abstraction

d) Encapsulation

iv. Which of the following is unchecked exception in java?

a) IOException

b) SQLException

c) NullPointerException

d) FileNotFoundException

iv. Which of the following keyword is used to derive child interface from parent interface?

a) Package

b) import

c) extends

d) implements

vi. What is process when two or more threads need to access share resource, they need some way to ensure that resource will used by only one thread at a time?

a) Deadlock

b) Synchronization

c) Interthread communication

d) Starvation

vii. Which of the following class is used to read data from file in character Stream?

a) FileInputStream

b) FileOutputStream

c) FileReader

d) FileWriter

viii. Which of the following is not method of Iterator?

a) hasNext()

b) next()

c) remove()

d) empty()

ix. What is name of swing control that is normally display one entry and act as dropdown list?

a) JList

b) JComboBox

c) JRadioButton

d) JCheckBox

X. Which of the following JDBC component is used to handle communication with database server?

a) DriverManager

b) Driver

c) Connection

d) SQLException

PREVIOUS POSTNEXT POST