OBJECT ORIENTED PROGRAMMING USING JAVA LAB
Java Programming Lab Experiments VR-23 2025-26
Experiment 1: Fibonacci Sequence
- The Fibonacci sequence is defined by the following rule. The first 2 values in the sequence are 1, 1.
- Every subsequent value is the sum of the 2 values preceding it.
- Write a Java Program that uses both recursive and non recursive functions to print the nth value of the Fibonacci sequence.
Download Experiment 1
Experiment 2: Prime Numbers
- Write a Java Program that prompts the user for an integer.
- Print out all the prime numbers up to that Integer.
Download Experiment 2
Experiment 3: Palindrome String
- Write a Java Program that checks whether a given string is a palindrome or not.
- Example: MALAYALAM is a palindrome.
Download Experiment 3
Experiment 4: Sorting Names
- Write a Java Program for sorting a given list of names in ascending order.
Download Experiment 4
Experiment 5: Runtime Polymorphism
- Write a Java Program that illustrates how runtime polymorphism is achieved.
Download Experiment 5
Experiment 6: Packages Demonstration
- Write a Java Program to create and demonstrate packages.
Download Experiment 6
Experiment 7: StringTokenizer Integers
- Write a Java Program, using StringTokenizer class.
- Read a line of integers and display each integer.
- Display the sum of all integers.
Download Experiment 7
Experiment 8: File Information & FileInputStream
- Read a file name from the user.
- Display whether the file exists.
- Display whether the file is readable or writable.
- Display the type of file and the length of the file in bytes.
- Display the contents using FileInputStream class.
Download Experiment 8
Experiment 9: File Character, Line, Word Count
- Write a Java Program that displays the number of characters, lines and words in a text file.
Download Experiment 9
Experiment 10: Simple Calculator (GUI)
- Write a Java Program that works as a simple calculator.
- Use a grid layout to arrange buttons for digits and + - * / % operations.
- Add a text field to display the result.
Download Experiment 10
Experiment 12: Thread Life Cycle
- Write a Java Program demonstrating the life cycle of a thread.
Download Experiment 12
Experiment 13: Pie Chart GUI
- Write a Java Program that lets users create Pie charts.
- Design your own user interface using Swings and AWT.
Download Experiment 13
Experiment 14: Queue with User Defined Exception
- Write a Java Program to implement a Queue.
- Use user defined Exception Handling.
- Make use of throw and throws.
Download Experiment 14
Web Resources
- https://www.iitk.ac.in/esc101/05Aug/tutorial/information/resources.html
- https://labex.io/skilltrees/java
- https://docs.oracle.com/javase/tutorial/index.html
- https://introcs.cs.princeton.edu/java/home/
No comments