Practical-1
Objective: Write a Java program to accept student details
(name, age, course) via command-line arguments and display
them.
Code:
Output :
Practical-2
Objective: Implement a Java program to accept an array of
integers, find the maximum and minimum elements, and
display them.
Code:
Output:
Practical-3
Objective: Develop a simple calculator using switch-
case that performs addition, subtraction,
multiplication, and division.
Code :
Output :
Practical-4
Objective: Write a Java program to check whether a given
string is a palindrome using StringBuffer.
Code:
Output:
Practical-5
Objective: Implement a program where a base class
Employee has attributes name, ID, and salary, and derived
classes calculate bonuses for different employee types.
Code:
Output:
Practical-6
Objective: Develop a Java program where one class
implements multiple interfaces to demonstrate multiple
inheritance.
Code:
Output:
Practical-7
Objective: Create a user-defined package of math
operations that contains classes for addition, subtraction,
multiplication, and division, and use them in a main program.
Code:
Output:
Practical-8
Objective: Implement a Java program to handle division by
zero exception using try-catch and finally blocks.
Code:
Output:
Practical-9
Objective: Create a Java program that spawns two threads:
one prints even numbers, the other prints odd numbers up to
100.
Code:
Output:
Practical-10
Objective: Implement a Java program where multiple
threads try to withdraw money from a shared bank account,
ensuring proper synchronization.
Code:
Output:
Practical-11
Objective: Create a Java program that connects to a MySQL
database, inserts student records, and retrieves them using
JDBC.
Code:
Output: