BIT401 · TU past paper
Advanced Java Programming 2081 question paper
The complete TU 2081 exam paper for Advanced Java Programming (BIT401), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- 110 marksServlet APIsHideAnswer
Discuss about any four servlet APIs. Design a form in JSP to take the necessary information about an employee and when the user click submit button, it will be displayed in second page.[10]
The HttpServletRequest object contains the request sent by the client to the server. Key methods include: - getParameter(String name) - retrieves a single parameter value from the request - getParameterValues(String name) - retrieves mul...
- 210 marksMenu items with mnemonics and acceleratorsHideAnswer
When do we use JPanel? How do you add mnemonics and accelerators to menu items? Explain.[10]
JPanel is a lightweight container component in Java Swing used in the following scenarios: 1. Organizing Components: JPanel groups related GUI components together logically. For example, grouping buttons, text fields, or labels that form...
- 310 marksInner classes and anonymous inner classesHideAnswer
How do you create inner class and anonymous inner class? Create a class EMPLOYEE with data members Emp_ID, Name and Occupation, and write those objects to the file DOC.DAT whose occupations is doctor.[10]
An inner class is a class defined within another class. It has access to the outer class's members. Syntax: Creating objects: An anonymous inner class is a class without a name, typically used to override methods of an interface or abstr...
- 45 marksJavaFX layoutsHideAnswer
Describe about any three types of JavaFX layouts. [5]
JavaFX provides several layout panes to organize and position UI components. Here are three important types: --- BorderPane divides the layout area into five regions: top, bottom, left, right, and center. - Structure: The center region e...
- 55 marksEvent handling and action commandsHideAnswer
Write a program to design a form with a button and label, such that the number of times the button is clicked will be displayed in label. [5]
Key Components: 1. Window Creation: tk.Tk() creates the main application window with title and size. 2. Global Counter: clickcount variable stores the number of button clicks. 3. Click Handler Function: onbuttonclick() function: - Increm...
- 65 marksRMI architecture and componentsHideAnswer
Explain the architecture of RMI. [5]
RMI is a Java mechanism that allows a program running on one JVM to invoke methods on objects residing in another JVM. The architecture consists of the following layers: - Contains the client and server applications - Client invokes remo...
- 75 marksMouse events and keyboard eventsHideAnswer
Write a program to show the use of mouse event. [5]
Since reference notes are not provided, this answer follows standard web-based mouse event handling appropriate for BSc CSIT curriculum. Event Description -------------------- mouseover Triggered when mouse pointer enters element mouseou...
- 85 marksPackage definition and organizationHideAnswer
Define package. What is the use of final keyword and finally block? [5]
A package is a namespace mechanism in Java used to organize and group related classes, interfaces, and sub-packages into a hierarchical structure. Packages help avoid naming conflicts and provide a way to control access to classes and me...
- 95 marksJDBC architecture and driver typesHideAnswer
Explain the architecture of JDBC and list the JDBC driver types. [5]
JDBC (Java Database Connectivity) follows a layered architecture consisting of two main layers: - This is the top layer where Java applications interact with databases - Applications use JDBC API to communicate with databases - Developer...
- 105 marksUDP socket programming stepsHideAnswer
Write the steps of writing socket program using UDP. [5]
UDP (User Datagram Protocol) is a connectionless, unreliable transport layer protocol. The following are the steps to write a UDP socket program: 1. Create a socket - Use socket() system call with parameters: AFINET (address family), SOC...
- 115 marksScriptlets and JSP access modelsHideAnswer
Define scriptlets. Discuss about JSP access models. [5]
Scriptlets are blocks of Java code embedded directly within JSP (JavaServer Pages) documents. They are enclosed within <% ... % tags and allow developers to write Java logic that executes on the server side during page processing. Syntax...
- 125 marksPort usage and significanceHideAnswer
Why do we need ports in socket programming? What types of instructions are written in try block? [5]
Ports serve the following critical purposes: 1. Process Identification: Ports uniquely identify specific processes or services running on a host machine. Since a single computer can run multiple network applications simultaneously, ports...