Podcast
Questions and Answers
What is the primary reason for using a layout manager instead of manually laying out components in Java?
What is the primary reason for using a layout manager instead of manually laying out components in Java?
What method is used to associate a layout manager with a Container object?
What method is used to associate a layout manager with a Container object?
What happens when you pass null to the setLayout() method?
What happens when you pass null to the setLayout() method?
Which of the following constructors for FlowLayout specifies horizontal and vertical gaps between components?
Which of the following constructors for FlowLayout specifies horizontal and vertical gaps between components?
Signup and view all the answers
Which of the following methods is primarily associated with the Component class?
Which of the following methods is primarily associated with the Component class?
Signup and view all the answers
What is the default alignment for components when using FlowLayout?
What is the default alignment for components when using FlowLayout?
Signup and view all the answers
Which container cannot contain a title bar and menubars but can still hold buttons or text fields?
Which container cannot contain a title bar and menubars but can still hold buttons or text fields?
Signup and view all the answers
Which layout manager is characterized by a flowing layout similar to a text editor?
Which layout manager is characterized by a flowing layout similar to a text editor?
Signup and view all the answers
What type of layout does the FlowLayout manager use by default?
What type of layout does the FlowLayout manager use by default?
Signup and view all the answers
What is the correct name of the method to alter the layout of a Java container?
What is the correct name of the method to alter the layout of a Java container?
Signup and view all the answers
Which Swing class is utilized for creating frames in a Java application?
Which Swing class is utilized for creating frames in a Java application?
Signup and view all the answers
If you want to disable a layout manager in Java, which value should be passed to setLayout()?
If you want to disable a layout manager in Java, which value should be passed to setLayout()?
Signup and view all the answers
Which method will set the text of a Label object in Java?
Which method will set the text of a Label object in Java?
Signup and view all the answers
What event is generated by pressing a button in Java?
What event is generated by pressing a button in Java?
Signup and view all the answers
Which package contains all the necessary classes and methods for event handling in Java?
Which package contains all the necessary classes and methods for event handling in Java?
Signup and view all the answers
In Java, what term describes an area on the screen bounded by borders and containing various interface elements?
In Java, what term describes an area on the screen bounded by borders and containing various interface elements?
Signup and view all the answers
What is the primary function of the List class?
What is the primary function of the List class?
Signup and view all the answers
What does the numRows parameter specify in the List constructor List(int numRows)?
What does the numRows parameter specify in the List constructor List(int numRows)?
Signup and view all the answers
How do you add a new item to a List at a specific index?
How do you add a new item to a List at a specific index?
Signup and view all the answers
Which method would you use to retrieve the index of the currently selected item in a List?
Which method would you use to retrieve the index of the currently selected item in a List?
Signup and view all the answers
When implementing the ActionListener interface for a List, what does the getActionCommand() method return?
When implementing the ActionListener interface for a List, what does the getActionCommand() method return?
Signup and view all the answers
What will the method getSelectedItem() return if no item has been selected?
What will the method getSelectedItem() return if no item has been selected?
Signup and view all the answers
Which statement is true regarding the multipleSelect parameter in the List constructor?
Which statement is true regarding the multipleSelect parameter in the List constructor?
Signup and view all the answers
What is the purpose of the getItem(int index) method in the List class?
What is the purpose of the getItem(int index) method in the List class?
Signup and view all the answers
What is the primary purpose of the getConnection
method in JDBC?
What is the primary purpose of the getConnection
method in JDBC?
Signup and view all the answers
Which method is used to permanently save changes made in a transaction?
Which method is used to permanently save changes made in a transaction?
Signup and view all the answers
What does the setAutoCommit(boolean status)
method do?
What does the setAutoCommit(boolean status)
method do?
Signup and view all the answers
What is the role of the Stub
in RMI programming?
What is the role of the Stub
in RMI programming?
Signup and view all the answers
Which of the following methods would you use to close a JDBC connection?
Which of the following methods would you use to close a JDBC connection?
Signup and view all the answers
In RMI, what do the client and server applications interact with to communicate?
In RMI, what do the client and server applications interact with to communicate?
Signup and view all the answers
What does the createStatement(int resultSetType, int resultSetConcurrency)
method provide?
What does the createStatement(int resultSetType, int resultSetConcurrency)
method provide?
Signup and view all the answers
What happens when the rollback()
method is called?
What happens when the rollback()
method is called?
Signup and view all the answers
What method is used to change the selection mode of a JList?
What method is used to change the selection mode of a JList?
Signup and view all the answers
What is the primary purpose of the JButton class in Swing?
What is the primary purpose of the JButton class in Swing?
Signup and view all the answers
Which of the following selection modes does NOT exist in ListSelectionModel?
Which of the following selection modes does NOT exist in ListSelectionModel?
Signup and view all the answers
How can you obtain the action command associated with a JButton?
How can you obtain the action command associated with a JButton?
Signup and view all the answers
Which class should a Swing applet extend to gain Swing functionality?
Which class should a Swing applet extend to gain Swing functionality?
Signup and view all the answers
What is generated when a JButton is pressed?
What is generated when a JButton is pressed?
Signup and view all the answers
Which method must be implemented to handle button press events in a JButton?
Which method must be implemented to handle button press events in a JButton?
Signup and view all the answers
When using multiple buttons, how can you identify which button was pressed?
When using multiple buttons, how can you identify which button was pressed?
Signup and view all the answers
What is the primary use of persistent cookies?
What is the primary use of persistent cookies?
Signup and view all the answers
Which method of the Cookie class is used to change the value of a cookie?
Which method of the Cookie class is used to change the value of a cookie?
Signup and view all the answers
How does a persistent cookie differ from a session cookie?
How does a persistent cookie differ from a session cookie?
Signup and view all the answers
Which class in the javax.servlet package is used to provide an output stream for sending binary data to the client?
Which class in the javax.servlet package is used to provide an output stream for sending binary data to the client?
Signup and view all the answers
What happens to persistent cookies when they expire?
What happens to persistent cookies when they expire?
Signup and view all the answers
Which method returns the name of a cookie?
Which method returns the name of a cookie?
Signup and view all the answers
What does the GenericServlet class do?
What does the GenericServlet class do?
Signup and view all the answers
What type of notifications does the ServletContextAttributeEvent class generate?
What type of notifications does the ServletContextAttributeEvent class generate?
Signup and view all the answers
Study Notes
Advanced Java Programming - Question Bank
- V SEMESTER BCA
- Course: Advanced Java Programming
- Course Code: 22CAC-13
Module I
-
Applet Output Display: The
paint()
method is used to display applet output. -
String Output in Applet: The
drawString()
method is used to output strings within an applet. - AWT: Acronym for Abstract Window Toolkit, a Java API for creating graphical user interfaces.
-
Exception in
read()
method: Theread()
method can throw anIOException
. -
Input/Output Packages: The
java.io
package provides classes and interfaces for input/output operations. -
Non-member class of
java.io
package:java.io.Writer
is not a member class,java.io.StringReader
is. -
Non-input/output related class:
java.io.File
is not related to input/output stream functionality. -
Byte Streams:
java.io.InputStream
andjava.io.OutputStream
are used for reading and writing byte data. -
Character Streams:
java.io.Reader
andjava.io.Writer
are used for reading and writing character data.
Module II
-
Container without title bar/menu: A
Panel
is a container that does not have a title bar or menu bar. -
Event handling package:
java.awt.event
provides event classes and listener interfaces for event handling. -
Rectangle drawing: The
drawRect(int x, int y, int width, int height)
method in thejava.awt.Graphics
class draws a rectangle. -
GUI application window: A
Frame
is a window that represents a GUI application and can have a title bar, icon, and menus. -
ActionListener
implementation: There are several ways to implement theActionListener
interface: by creating a new class, using an anonymous inner class, etc.
Module III
-
Graphics methods: The
Graphics
class provides methods for graphics programming tasks. -
Label text handling: The
setText()
method is used to set the text displayed in aLabel
object. -
Container layout: A Container's layout can be altered using the
setLayout()
method, which accepts aLayoutManager
object. -
Key press detection: Use the
getKey()
method for detecting a pressed key.. -
Methods invoked for button press: An
ActionEvent
is generated when a button is pressed. -
Event handling package:
java.awt.event
is the package containing classes for event handling. -
GUI window object: A
Frame
is a visible window in a GUI application. -
String
Label
modification: TheLabel
class has asetText()
method to change the text of the label. -
Passive controls: Controls like
Labels
are passive, they don't respond to user interaction directly.
Module IV - JDBC
- Query Compilation: A JDBC query is compiled when it's prepared.
-
Data Transfer: JDBC's
ResultSet
,PreparedStatement
, andCallableStatement
methods handle data transfer between applications and databases. - UDA Acronym: Universal Data Access
-
Connection establishment: The
DriverManager
class'sgetConnection()
methods establish connections to databases. - JDBC Driver Types: JDBC technology provides: JDBC-ODBC bridge, NativeAPI, NetworkProtocol, and Thin drivers.
-
JDBC core package:
java.sql
is the core package. -
RMI Methods: The
Naming
class has methods likerebind()
to manage remote objects. -
Executing SQL Queries: Using the
executeQuery()
method to retrieve data is very common.
Module V
- Cookies: Used for client-side maintaining session information. Cookies can be persistent or non-persistent (stateful or stateless).
-
Servlet Lifecycle Methods:
init()
,service()
,destroy()
are the primary lifecycle methods for a Servlet.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.