Java
Java
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)
(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 code to Update the record (As per the roll no).
• Write a code to search the record as per the Search (Button mentioned above).