0% found this document useful (0 votes)
3 views2 pages

Java P.file (1)

The document outlines a series of Java programming tasks, including creating classes, performing array operations, implementing inheritance and interfaces, and demonstrating multithreading and synchronization. It also covers the use of collections like ArrayList and HashMap, as well as file handling and GUI development with Swing. Additionally, it includes error handling for exceptions and creating a basic Servlet.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Java P.file (1)

The document outlines a series of Java programming tasks, including creating classes, performing array operations, implementing inheritance and interfaces, and demonstrating multithreading and synchronization. It also covers the use of collections like ArrayList and HashMap, as well as file handling and GUI development with Swing. Additionally, it includes error handling for exceptions and creating a basic Servlet.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Java file

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.

6. Create a program demonstrating method overloading with different numbers and


types of parameters.
7. Write a Java program to implement method overriding using base and derived
classes.

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.

You might also like