Probability Engine · CSC409

Advanced Java Programming (BSc CSIT, CSC409): the questions likely to come

93 analyzed questions from 8 past papers (2074-2082), grouped by syllabus unit — each with its probability, how often it's been asked, and where to study the answer.

8
Papers analyzed
2074-2082
93
Analyzed questions
across 7 syllabus units
5
Very likely units
high-probability topics
4
Units = 80% of marks
study these first
Model answers for this subject are being written. Every question links to its original paper so you can study from the source meanwhile.
Pick a unit
U2 · Q1/28 · 208210 marks
Event Handling and GUI Programming

Write a JavaFX application that creates a ChoiceBox with a list of colors. Display a label that changes its text based on the selected color from the ChoiceBox. Write down steps for writing CORBA programs with a suitable example.

18%
Occasional to appearAppeared in 1 of the last 1 board papers
Seen in
How well do you know this?rating moves you on
MODEL ANSWERU2 · 10 marks

JavaFX ChoiceBox Application

ChoiceBox is a JavaFX control that shows a drop-down list of items for single selection. We listen to its selection model with a ChangeListener (or a binding) and update a Label whenever the chosen color changes.

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;

public class ColorChoiceApp extends Application {
    @Override
    public void start(Stage stage) {
        ChoiceBox<String> choiceBox = new ChoiceBox<>();
        choiceBox.getItems().addAll("Red", "Green", "Blue", "Yellow");
        choiceBox.setValue("Red");

        Label label = new Label("Selected color: Red");

        // Update label whenever the selected color changes
        choiceBox.getSelectionModel().selectedItemProperty().addListener(
            (obs, oldVal, newVal) -> label.setText("Selected color: " + newVal));

        VBox root = new VBox(10, choiceBox, label);
        Scene scene = new Scene(root, 300, 150);
        stage.setTitle("ChoiceBox Demo");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}

When the user picks a color from the ChoiceBox, the listener fires and the Label text changes to reflect the selection.

Steps for Writing CORBA Programs

CORBA (Common Object Request Broker Architecture) is a standard from the OMG that lets objects written in different languages on different machines communicate through an ORB (Object Request Broker) using IDL (Interface Definition Language).

Steps:

  1. Define the interface in IDL — declare the remote operations in a language-neutral .idl file.
  2. Compile the IDL with the IDL-to-Java compiler (idlj) to generate the stub (client side), skeleton (server side), and helper/holder classes.
  3. Implement the servant — write a Java class that extends the generated skeleton (...POA) and implements the interface operations.
  4. Write the server — create the ORB, get the POA, instantiate the servant, register/bind its object reference with the Naming Service, and wait for requests.
  5. Write the client — initialize the ORB, look up the object reference from the Naming Service, narrow it to the interface type, and invoke remote methods.
  6. Run — start orbd (the naming/activation daemon), then the server, then the client.

Example IDL — Hello.idl

module HelloApp {
    interface Hello {
        string sayHello();
    };
};

Servant

import HelloApp.*;
class HelloImpl extends HelloPOA {
    public String sayHello() { return "Hello from CORBA server"; }
}

Server (skeleton)

ORB orb = ORB.init(args, null);
POA rootpoa = POAHelper.narrow(orb.resolve_initial_references("RootPOA"));
rootpoa.the_POAManager().activate();
HelloImpl servant = new HelloImpl();
org.omg.CORBA.Object ref = rootpoa.servant_to_reference(servant);
Hello href = HelloHelper.narrow(ref);
// bind 'href' in the naming service, then orb.run();

Client (skeleton)

ORB orb = ORB.init(args, null);
// resolve "Hello" from naming service into 'helloRef'
Hello helloRef = HelloHelper.narrow(ncRef.resolve_str("Hello"));
System.out.println(helloRef.sayHello());

Thus CORBA achieves language- and platform-independent distributed object communication via IDL and the ORB.

AI-generated answer · unverifiedView in 2082 paper →
U2 · Question 1 of 28
Question Priority · U2ranked by appearance likelihood — study top-down

Event Handling and GUI Programming

Analyzed next18%
1
★ TOP PICK

Write a JavaFX application that creates a ChoiceBox with a list of colors. Display a label that changes its text based on the selected color from the ChoiceBox. Write down steps for writing CORBA programs with a suitable example.

10 marksSEEN IN
18%
2

Explain GUI programming using Swing. Discuss the component hierarchy and write a program to build a registration form with validation using Swing components.

10 marksSEEN IN
16%
3

Describe the Java event handling mechanism with appropriate examples. Write a Swing GUI program that implements a simple calculator with buttons for basic arithmetic operations.

10 marksSEEN IN
14%
4

Explain the delegation event model. Write a Swing program that demonstrates handling of action events and item events on multiple components.

10 marksSEEN IN
13%
5

Discuss the architecture of Swing. Write a GUI application using Swing that accepts user details through text fields and displays them in a dialog box.

10 marksSEEN IN
12%
6

Explain event-driven programming in Java. Discuss the event delegation model and write a program demonstrating handling of mouse events.

10 marksSEEN IN
11%
7

Write a program to insert an icon in the frame and when the user presses the up arrow, it will move upward.

5 marksSEEN IN
18%
8

Write a program to design a layout of a simple calculator. (Arithmetic operation not required.)

5 marksSEEN IN
18%
9

Write a program to demonstrate the concept of internal frame.

5 marksSEEN IN
18%
10

Do we still need Java Applet? Justify. Give the hierarchy of Swing class.

5 marksSEEN IN
18%
11

Compare AWT with Swing. Explain the MVC architecture used in Swing components with a suitable diagram.

10 marksSEEN IN
9%
12

Explain the JList and JComboBox components.

5 marksSEEN IN
16%
13

What is the delegation event model? List its components.

5 marksSEEN IN
16%
14

What is Swing? Explain the benefits of using Swing components over AWT. Write a GUI program using Swing components to find the sum and difference of two numbers.

10 marksSEEN IN
8%
15

Explain any three Swing layout managers.

5 marksSEEN IN
14%
16

Differentiate between AWT and Swing components.

5 marksSEEN IN
14%
17

What is an event source and an event listener?

5 marksSEEN IN
13%
18

Explain the JScrollPane and JTabbedPane components.

5 marksSEEN IN
13%
19

Discuss any three event listener interfaces in Java.

5 marksSEEN IN
12%
20

What is the difference between a container and a component in Swing?

5 marksSEEN IN
12%
21

Explain the CardLayout manager with an example.

5 marksSEEN IN
12%
22

What are the benefits of using Swing components?

5 marksSEEN IN
11%
23

What is a layout manager? Explain GridLayout.

5 marksSEEN IN
11%
24

What is the use of the JTable component? Explain.

5 marksSEEN IN
9%
25

Explain adapter classes in Java event handling.

5 marksSEEN IN
9%
26

Discuss any three event classes in Java with examples.

5 marksSEEN IN
8%
27

What is a layout manager? Explain BorderLayout and FlowLayout.

5 marksSEEN IN
8%
28

Explain the delegation event model in Java.

5 marksSEEN IN
8%
03The mock

Sit a probable paper

A full mock exam built from the most likely questions, mirroring the real paper's structure. Every slot is a real past question.

Most Probable Paper

Mirrors the real structure · 60 marks · based on 8 past papers

Section A: Long Answer QuestionsAttempt any TWO questions.
  1. 1.

    Write a JavaFX application that creates a ChoiceBox with a list of colors. Display a label that changes its text based on the selected color from the ChoiceBox. Write down steps for writing CORBA programs with a suitable example.

    [10 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2082 paper →

    Asked once (2082); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  2. 2.

    Explain GUI programming using Swing. Discuss the component hierarchy and write a program to build a registration form with validation using Swing components.

    [10 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2081 paper →

    Asked once (2081); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  3. 3.

    Describe the Java event handling mechanism with appropriate examples. Write a Swing GUI program that implements a simple calculator with buttons for basic arithmetic operations.

    [10 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2080 paper →

    Asked once (2080); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

Section B: Short Answer QuestionsAttempt any EIGHT questions.
  1. 1.

    What is the difference between TCP and UDP socket programming?

    [5 marks]
    Network ProgrammingVery likelyfrom 2080 paper →

    This question has recurred in 3 of 8 years; so far only in internal assessments, not the board; and its topic (Network Programming) appears in 100% of years.

  2. 2.

    Write short notes on exception handling in JDBC.

    [5 marks]
    Multithreading Programming and Database ConnectivityVery likelyfrom 2080 paper →

    This question has recurred in 2 of 8 years; so far only in internal assessments, not the board; and its topic (Multithreading Programming and Database Connectivity) appears in 100% of years.

  3. 3.

    Write a program to insert an icon in the frame and when the user presses the up arrow, it will move upward.

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2082 paper →

    Asked once (2082); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  4. 4.

    Write a program to design a layout of a simple calculator. (Arithmetic operation not required.)

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2082 paper →

    Asked once (2082); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  5. 5.

    Write a program to demonstrate the concept of internal frame.

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2082 paper →

    Asked once (2082); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  6. 6.

    Do we still need Java Applet? Justify. Give the hierarchy of Swing class.

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2082 paper →

    Asked once (2082); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  7. 7.

    Explain the JList and JComboBox components.

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2081 paper →

    Asked once (2081); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  8. 8.

    What is the delegation event model? List its components.

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2081 paper →

    Asked once (2081); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

  9. 9.

    Explain any three Swing layout managers.

    [5 marks]
    Event Handling and GUI ProgrammingVery likelyfrom 2080 paper →

    Asked once (2080); so far only in internal assessments, not the board; and its topic (Event Handling and GUI Programming) appears in 100% of years.

04The receipts

Behind the numbers

The raw evidence the predictions are computed from: marks per unit per year, syllabus weights, trends, and coverage.

Show the heatmap, topic table and coverage analysis

The receipt: marks per unit, per year

Each row is a syllabus unit, each column an exam year, each cell the marks that unit earned that year. Click any cell to see the actual questions behind it.

Marks:nonefew → many
2074
2075
2077
2078
2079
2080
2081
2082
Total
U2Event Handling and GUI Programming
180
U4Network Programming
125
U3Multithreading Programming and Database Connectivity
110
U5Java Servlets
90
U6Java Server Pages (JSP)
75
U1Programming in Java
20
U7Enterprise JavaBeans (EJB) and Hibernate
0
#Syllabus unitProbabilityAppearedAvg marksSyllabus weightExam vs syllabusTrendQuestions
1U2Event Handling and GUI ProgrammingVery likely100%22.516%7 lecture hrsOver-examinedexam 30% · syllabus 16%Steadynone repeat28 total
2U4Network ProgrammingVery likely100%15.611%5 lecture hrsOver-examinedexam 21% · syllabus 11%Steady1 recurring18 total
3U3Multithreading Programming and Database ConnectivityVery likely100%13.818%8 lecture hrsBalancedexam 18% · syllabus 18%Steady1 recurring16 total
4U5Java ServletsVery likely100%11.213%6 lecture hrsBalancedexam 15% · syllabus 13%Fadingnone repeat15 total
5U6Java Server Pages (JSP)Very likely100%9.413%6 lecture hrsBalancedexam 12% · syllabus 13%Steadynone repeat12 total
6U1Programming in JavaOccasional25%1011%5 lecture hrsUnder-examinedexam 3% · syllabus 11%Risingnone repeat4 total
7U7Enterprise JavaBeans (EJB) and HibernateOccasional0%
018%8 lecture hrsUnder-examinedexam 0% · syllabus 18%SteadyNone

Study smart, not hard

Drag the slider: studying the top 4 units in priority order covers ~84% of all observed marks.

  1. ~80% line

Lecture time vs exam marks

Where the exam pays more than the curriculum spends: ● lectures vs ● exam marks, as a share of the whole course. A long teal-leading bar = high-yield unit.

U2Event Handling and GUI Programming
16% of lectures → 30% of markshigh yield
U4Network Programming
11% of lectures → 21% of markshigh yield
U3Multithreading Programming and Database Connectivity
18% of lectures → 18% of marks
U5Java Servlets
13% of lectures → 15% of marks
U6Java Server Pages (JSP)
13% of lectures → 12% of marks
U1Programming in Java
11% of lectures → 3% of markslow yield
U7Enterprise JavaBeans (EJB) and Hibernate
18% of lectures → 0% of markslow yield

Topics are the official CSC409 syllabus units. Predictions are data-driven probabilities computed from 8 past papers (2074-2082) by mapping each real question to its syllabus unit. They indicate what has historically been likely, not guaranteed questions. Always study the full syllabus.