100% found this document useful (1 vote)
158 views

APP Question Bank Unit3

The document is a question bank for the subject 21CSC203P - Advanced Programming Practice for semester 3. It contains 24 multiple choice questions related to various programming paradigms including concurrent programming, declarative programming, and graphical user interface based programming. The questions assess students on topics like multithreading, Java Database Connectivity (JDBC), Java applets, Java Swing, and Spring MVC framework.

Uploaded by

nkrithika65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
158 views

APP Question Bank Unit3

The document is a question bank for the subject 21CSC203P - Advanced Programming Practice for semester 3. It contains 24 multiple choice questions related to various programming paradigms including concurrent programming, declarative programming, and graphical user interface based programming. The questions assess students on topics like multithreading, Java Database Connectivity (JDBC), Java applets, Java Swing, and Spring MVC framework.

Uploaded by

nkrithika65
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

SRM INSTITUTE OF SCIENCE AND TECHNOLOGY

Ramapuram Campus, BharathiSalai, Ramapuram, Chennai - 600089

COLLEGE OF ENGINEERING AND TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTIONBANK

DEGREE / BRANCH: B.Tech/CSE with Specializations AIML, BDA, CS


and IOT

SEMESTER: III

SUB CODE/SUBJECT NAME: 21CSC203P/ADVANCED PROGRAMMING


PRACTICE

Regulation– 2021

AcademicYear: 2022-24
SRMINSTITUTE OF SCIENCE AND
TECHNOLOGY
Ramapuram Campus, BharathiSalai, Ramapuram, Chennai-600089

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTIONBANK

SUBJECT : 21CSC203P -ADVANCED PROGRAMMING PRACTICE


SEM/YEAR: III/II
Course Outcomes
CO2:Devise solutions to the various programming paradigm
CO2:Express proficiency in the usage of structural, procedural, and Object-Oriented Program
CO3: Determine the Java application using declarative, event, and graphical user interface paradigm
CO4:Express proficiency in the usage of logic, functional, network, and concurrent Paradigm
CO5: Determine the Python application using symbolic, automata-based, and graphical user interface
programming paradigms

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

12 Applets are designed to be embedded within an __________.


A) Javascript
B) Css
CO2 L2
C) HTML
D) SQL
Answer : C) HTML
13 Which of the following is required to view an applet? CO2 L1
A) JCM
B) JDM
C) JVM
D) Java class
Answer : C) JVM

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

16 ___________ method is defined in Graphics class, it is used to output a string in an


applet.
A) display()
B) Print() CO2 L1
C) drawString()
D) transient()
Answer : C) drawString()
17 Which of the following architecture does the Swing framework use?
A) MVC
B) MVP
C) Layered architecture CO2 L1
D) Master-Slave architecture
Answer: A) MVC

18 An ____ is a change in the state of an item?


A) Spinner
B) Event L2
CO2
C) Occurrence
D) Activity
Answer: B) Event
19 How many types of events are there?
A) 5
B) 3
CO2 L2
C) 2
D) 4
Answer: C) 2
20 ____ is a container for other components and is used to build bespoke panels for
organizing and arranging components?
A) JPanel
B) JFrame CO2 L2
C) JCombo
D) JBox
Answer: A) JPanel
21 ____ are classes that act as a connection point between event listeners and event
sources?
A) Event adapters
B) Events Handler
CO2 L2
C) Event listener
D) Jevent
Answer: A) Event adapters

22 Which package contains the Java Swing classes? CO2 L2


A) java.lang
B) java.io
C) java.util
D) javax.swing
Answer:d) javax.swing
23 What does MVC stand for in Spring MVC?
A) Multi-View Controller
B) Module-View-Controller
CO2 L1
C) Model-View-Controller
D) Model-Value-Configuration
Answer : C) Model View Controller
24 What is the purpose of the ModelAndView object in Spring MVC?
A) To store and pass data between the controller and the view.
B) To define the layout and styling of the web application.
CO2 L2
C) To handle user authentication and authorization.
D) To manage the application's data access layer.
Answer : A) To store and pass data between the controller and the view.
25 Which of these events is generated when a button is pressed?
A) WindowEvent
B) ActionEvent
CO2 L2
C) KeyEvent
Answer: B) ActionEvent

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

PART C (12 Marks)


1 Explain in detail about Concurrent Programming Paradigm. CO2 L6
2 Write a Java Program for Demonstrating Thread States CO2 L2
3 Discuss the five steps for connecting JDBC. CO2 L3
4 Illustrate Applet life cycle with a diagram. CO2 L2
5 List the MVC layers and Explain. CO2 L6

Note:

1. BT Level – Blooms Taxonomy Level

2. CO – Course Outcomes

BT1 –RememberBT2 – Understand BT3 – Apply BT4 – Analyze BT5 – Evaluate BT6 – Create

You might also like