Java P.file (1)
Java P.file (1)
1. Write a Java program to create a class Student with fields name, roll, and methods
to display student details.
2. Write a program to accept 10 integers in an array and find the largest and smallest
numbers.
3. Create a Java program to perform matrix addition using 2D arrays
4. Write a program to count the number of vowels, consonants, digits, and white spaces
in a given string.
5. Write a Java program to check whether a given string is a palindrome.
8. Create a user-defined package named shapes that contains classes for Circle,
Rectangle, and Triangle, and use them in another class.
9. Write a program to show the use of access modifiers (public, private, protected)
with packages
10. Write a program showing single inheritance where a class Employee is extended by
Manager.
11. Create a program demonstrating multilevel inheritance (e.g., Person → Employee
→ Programmer).
12. Write a Java program to implement an interface Vehicle with methods start() and
stop(), and classes Bike and Car that implement it.
13. Write a Java program to create two threads: one for printing even numbers and one
for odd numbers.
14. Implement thread synchronization where two threads try to access a common
counter.
15. Create a Java program using ArrayList to store names and sort them alphabetically.
16. Write a program to demonstrate the use of HashMap to store student roll numbers and
names.
17. Design a Swing application with a form containing a text field, label, and a button.
When the button is clicked, display the entered text on the label.
18. Write a Java program to read data from a file and write the content in another file
using streams.
19. Write a program to accept two numbers and perform division. Handle
ArithmeticException if the denominator is zero.
20. Create a basic Servlet that prints "Welcome to Java Lab" on the browser.