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

CS 304 Java Programming Second Assignment For BTECH V SEMESTER

Uploaded by

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

CS 304 Java Programming Second Assignment For BTECH V SEMESTER

Uploaded by

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

BTECH(CS) V SEMESTER (JAVA PROGRMMING) 2024

SECOND ASSIGNMENT

TOTAL MARKS: - 10

Q1. Write a program to create a class “STUDENT” with the data members
Rollno, Name, Course, Branch, and Semester. Store them in an array of
objects and perform the following operation:

 Sorted list of student in the ascending order of Name.

Q2. (a) What is super keyword in Java? Demonstrate the use of


parameterized constructor in inheritance.
(b) Explain interface in JAVA. How do interfaces support polymorphism?

Q3. What is a package? Explain the various packages that are available in
Java. How are classes added into a user defined package?

OR

Q- Give the general form of the import statement. Illustrate a Java program
that creates a package and uses it.

Q4. Explain Exception handling in JAVA. Write an application that generates


custom exception if any value is negative.

Q5. Write a Java program to raise and handle the following exception

1. Arithmetic Exception

2. ArrayIndexOutOfBoundsException

3. NullPointerException

4. NumberFormatException

5. InputMismatchException

Q6. Write a program for user defined exception that checks the internal and
external marks. If the internal mark is greater than 40, it raises the exception
“internal marks is exceed”. If the external mark is greater than 60, it raises
the exception and display the message “external marks is exceed”. Create
the above exception and use it in your program.

Q7. Write a Java program to throw user defined exception.

1
BTECH(CS) V SEMESTER (JAVA PROGRMMING) 2024
SECOND ASSIGNMENT

Q8. Explain Thread Life Cycle in detail. Write a code to create Thread in
JAVA.

Q9. Differentiate between Runnable Interface and Thread in Java with


appropriate example. How can the priorities of a thread be set, explain.

Q10. Why synchronization is required in multithreaded programming and


how can we implement it in program?

Q11. Write short notes on:

a. GUI Components

b. Wrapper class

Q12. Explain the following:

i. Applet vs. Application

ii. Java and Internet

iii. Basic feature of HTML

You might also like