CS 304 Java Programming Second Assignment For BTECH V SEMESTER
CS 304 Java Programming Second Assignment For BTECH V SEMESTER
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:
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.
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.
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.
a. GUI Components
b. Wrapper class