CSC419 · TU past paper
Advanced Java Programming 2078 question paper
The complete TU 2078 exam paper for Advanced Java Programming (CSC419), all 12 questions with solved model answers written to the mark scheme.
Tap a question to open its answer.
- 110 marksIntroductionHideAnswer
Compare AWT with Swing. Write a GUI program using components to find sum and difference of two numbers. Use two text fields for giving input and a label for output. The program should display sum if user presses mouse and difference if user release mouse.[10]
--- Feature AWT (Abstract Window Toolkit) Swing --------- Package java.awt javax.swing Components Heavyweight (depend on OS native components) Lightweight (drawn by Java itself, not OS) Look and Feel Platform dependent (looks different o...
- 210 marksWeb Container, Introduction to Servlets, LHideAnswer
Explain life-cycle of servlet in detail. Create a simple servlet that reads and displays data from HTML form. Assume form with two fields username and password.[10]
The servlet life cycle defines how a servlet is loaded, initialized, used, and destroyed by the servlet container (e.g., Apache Tomcat). It is managed entirely by the servlet container. --- - When the servlet container starts (or when th...
- 310 marksJava ArchitectureHideAnswer
Explain RMI architecture layers in detail. Write a Java programs using RMI to find product of two numbers.[10]
Remote Method Invocation (RMI) is a Java API that allows an object running in one Java Virtual Machine (JVM) to invoke methods on an object running in another JVM. It is the mechanism that makes Java truly distributed (as mentioned in Ja...
- 45 marksPackagesHideAnswer
What is package? How can you create your own package in Java? Explain with example. [5]
A package in Java is a namespace that organizes a set of related classes and interfaces together. It is essentially a folder/directory that groups related Java classes, interfaces, and sub-packages. Packages help in: - Avoiding name conf...
- 55 marksGUI ControlsHideAnswer
Why do we need swing components? Explain the uses of check boxes and radio buttons in GUI programming. [5]
--- Java Swing is part of the Java Foundation Classes (JFC) used to create window-based (GUI) applications. It is built on top of AWT (Abstract Windowing Toolkit) and is entirely written in Java. We need Swing components because of the f...
- 65 marksEvent Handling Concept, Listener InterfaceHideAnswer
How can we use listener interface to handle events? Compare listener interface with adapter class. [5]
A listener interface is a predefined interface in Java (in java.awt.event package) that contains abstract methods corresponding to specific events. To handle events using a listener interface, the following steps are followed: Step 1: Im...
- 75 marksDDL and DML Operations using Java, PrepareHideAnswer
What is row set? Explain cached row set in detail. [5]
A RowSet is a Java interface that extends the ResultSet interface and provides a more flexible and convenient way to handle tabular data from a database. It is part of the javax.sql package. - It is a JavaBean component, meaning it suppo...
- 85 marksJava Mail API, Sending and Receiving EmailHideAnswer
What is Java Mail API? How can you use this API to send email messages? [5]
The JavaMail API is an API used to compose, write, and read electronic messages (emails). It provides a protocol-independent and platform-independent framework for sending and receiving emails. The core classes of JavaMail API are found ...
- 95 marksIntroduction, JavaFX vs Swing, JavaFX LayoHideAnswer
Compare JavaFX with swing. Explain HBox and BBox layouts of JavaFX. [5]
Swing JavaFX ----------------------- Swing is the standard toolkit for Java developers in creating GUI. JavaFX provides platform support for creating desktop applications. Swing has a more sophisticated set of GUI components. JavaFX has ...
- 105 marksServlet vs JSP, JSP Access Model, JSP SyntHideAnswer
What is servlet? Write a simple JSP file to display 'Tribhuvan University' five times. [5]
--- A Servlet is a Java program that runs on the server side and is used to handle client requests and generate dynamic web content (typically HTML) as a response. Key points about Servlet: - It is a Java class that extends HttpServlet -...
- 115 marksIntroduction to CORBA, RMI vs CORBA, ArchiHideAnswer
Why CORBA is important? Compare CORBA with RMI. [5]
CORBA (Common Object Request Broker Architecture) is a standard defined by the Object Management Group (OMG) that enables communication between objects written in different programming languages running on different platforms. 1. Languag...
- 125 marksJDBC Architecture, JDBC Driver Types, JDBCHideAnswer
Write short notes on: a. JDBC drivers b. Java server pages [2.5+2.5]
--- JDBC (Java Database Connectivity) provides a standard API for Java applications to interact with databases. A JDBC driver is a software component that enables Java applications to communicate with a database by translating JDBC metho...