APP Question Bank Unit3
APP Question Bank Unit3
QUESTIONBANK
SEMESTER: III
Regulation– 2021
AcademicYear: 2022-24
SRMINSTITUTE OF SCIENCE AND
TECHNOLOGY
Ramapuram Campus, BharathiSalai, Ramapuram, Chennai-600089
QUESTIONBANK
UNIT-III
Concurrent Programming Paradigm: Multithreading and Multitasking; Thread classes and methods - Declarative
Programming Paradigm: Java Database Connectivity (JDBC); Connectivity with MySQL – Query Execution; -
Graphical User Interface Based Programming Paradigm: Java Applet: Basics and Java Swing: Model View Controller
(MVC) and Widgets; Develop a java project dissertation based on the programming paradigm
PART-A (Multiple Choice Questions)
Q. Questions Course Competence
No Outcome BT Level
1 What is a thread in Java?
A) A light weight process that run independently within a a program
B) A data structure to store variable
CO2 L2
C) A loop
D) A synchronization mechanism
Ans: A light weight process that run independently within a a program
2 Which class is used to create a thread in Java?
A) Thread
B) Runnable
CO2 L1
C) Process
D) Executor
Answer: A) Thread
3 What is a race condition in Multi-threaded Java programming?
A) A situation where threads synchronize perfectly.
B) A situation where threads never finish execution
C) A situation where multiple threads access shared data simultaneously,
CO2 L3
leading to unpredictable results.
D) A situation where threads throw exceptions
Answer: C) A situation where multiple threads access shared data simultaneously,
leading to unpredictable results.
4 What is the output of the program? CO2 L2
class Multithreded_program
{ public static void main(String [] args)
{ Thread t = Thread.CurrentThread();
System.out.println(t);
}
}
A) Thread[main,5]
B) Thread[main,5,main]
C) Thread[5,main]
D) Thread[0]
Answer: B) Thread[main,5,main]
5 What are the major components of the JDBC?
A) DriverManager, Driver, Connection, Statement, and ResultSet
B) DriverManager, Driver, Connection, and Statement
CO2 L2
C) DriverManager, Statement, and ResultSet
D) DriverManager, Connection, Statement, and ResultSet
Answer: A) DriverManager, Driver, Connection, Statement, and ResultSet
6 Which of the following method is used to perform DML statements in JDBC?
A) executeResult()
B) executeQuery()
CO2 L2
C) executeUpdate()
D) execute()
Answer: C) executeUpdate()
7 Parameterized queries can be executed by?
A) Parameterized Statement
B) Prepared Statement
CO2 L1
C) Callable Statement and Parameterized Statement
D) All kinds of Statements
Answer: B) Prepared Statement
8 Identify the isolation level that prevents the dirty in the JDBC Connection class?
A) TRANSACTION_READABLE_READ
B) TRANSACTION_READ_COMMITTED
CO2 L1
C) TRANSACTION_READ_UNCOMMITTED
D) TRANSACTION_NONE
Answer: B) TRANSACTION_READ_COMMITTED
9 Which of the following driver is the fastest one?
A) JDBC-ODBC Bridge Driver
B) Native API Partly Java Driver
CO2 L1
C) Network Protocol Driver
D) JDBC Net Pure Java Driver
Answer: D) JDBC Net Pure Java Driver
10 Which of the following is the correct to register a JdbcOdbcDriver?
A) jdbc.odbc.JdbcOdbcDriver obj = new sun.jdbc.odbc.JdbcOdbcDriver();
B) odbc.JdbcOdbcDriver obj = new sun.odbc.JdbcOdbcDriver();
CO2 L1
C) jdbc.JdbcOdbcDriver obj = new sun.jdbc.JdbcOdbcDriver();
D) jdbc.odbc.JdbcOdbc obj = new sun.jdbc.odbc.JdbcOdbc();
Answer: A) jdbc.odbc.JdbcOdbcDriver obj = new sun.jdbc.odbc.JdbcOdbcDriver();
11 An applet is a Java class that extends the?
A) java.Applet class
B) java class
C) Applet class CO2 L2
D) java.applet.Applet class
Answer: D) java.applet.Applet class
14 Which method is automatically called after the browser calls the init method?
A) start
B) stop
CO2 L1
C) destroy
D) paint
Answer : A) start
15 Which method is only called when the browser shuts down normally?
A) start
B) stop
C) destroy CO2 L1
D) paint
Answer : C) destroy
PART B (4 Marks)
1 What are the advantages of multi threading? CO2 L2
2 Define abnormal termination. CO2 L1
3 Implement a java program to create threads. CO2 L3
4 How to run an Applet? CO2 L2
5 Discuss the types of JDBC divers. CO2 L2
6 Write a java program for displaying image in Applet. CO2 L2
7 Compare AWT and Swing. CO2 L4
8 Discuss the layers of MVC. CO2 L2
Note:
2. CO – Course Outcomes
BT1 –RememberBT2 – Understand BT3 – Apply BT4 – Analyze BT5 – Evaluate BT6 – Create