0% found this document useful (0 votes)
13 views

Java

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Java

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Java 2023

1. (a) Define Arrays in Java. State its classification. Write a Java programme to accept 10, 45,
67, 45, 67 values in an Array through user and print them.

(b) What is Interface in Java. Explain its usage. Explain how interfaces are used for
implementing multiple inheritance in Java. (CO1)

(c) Write a Program in Java to calculate Simple Interest. (SI: P*R*T/100). Here accept the
values for P, R, T by user through Scanner class. (C01)

2. (a) Describe packages in Java. State the benefits of using packages in Java. Write a
programme to create package shape and add the following (as given below) in the package.

(b) Illustrate the usage of throw and throws by using suitable example. (CO2)

(c) Define Exceptions in Java. Write a Java code to show the implementation of Array-
IndexOutofBoundException ArithmeticException. and

(CO2)

3. (a) Define Multithreading in Java ? Explain life cycle of thread? State the programme which
shows the difference between Runnable and Thread class. (CO3)

(b) Explain collections in Java. Write a programme to insert following values (5, 6, 7, 8, 4, 5)
through ArrayList Class. Also state the difference while adding these contents through simple
array or by using array list class ?

(CO3)

(c) Write a program to create a file, which stores information about (roll, name, address). All the
information is provided by the user during run time.

4.

(CO4)

(b) Define Swing in Java? Explain any five Java components associated with Swing by using
suitable example.

(CO4)

© Diagram
In above code Add/Sub/Multiply and Divide are the button(s). Now perform the following task by
using Applet/Swing to design the above application.

(CO4)

• Write a code by using Adapter or Interface for the following:

• Add: Button to add two numbers and display the result

o Sub Button to subtract two numbers and display the result

• Multiply: Button to multiply two numbers and display the result

• Divide: Button to divide two numbers and display the result

(CO5)

(b) Define JSP? Write some merits of JSP in comparison to servlets? Write a JSP programme
to accept two numbers and print greater number. (COS)

(c) Diagram

Write a Java Code to perform the following task [Search, Save and Update are Buttons):

• Write a JDBC code (Assume table emp(e_id,e_name, _course,e_address)

• Write a code to save the data in respective table.

• Write a code to Update the record (As per the roll no).

• Write a code to search the record as per the Search (Button mentioned above).

You might also like