OBJECT ORIENTED PROGRAMMING USING JAVA LAB

Java Programming Lab Experiments VR-23 2025-26

Java Programming Lab Experiments

Experiment 1: Fibonacci Sequence

  1. The Fibonacci sequence is defined by the following rule. The first 2 values in the sequence are 1, 1.
  2. Every subsequent value is the sum of the 2 values preceding it.
  3. 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

  1. Write a Java Program that prompts the user for an integer.
  2. Print out all the prime numbers up to that Integer.
Download Experiment 2

Experiment 3: Palindrome String

  1. Write a Java Program that checks whether a given string is a palindrome or not.
  2. Example: MALAYALAM is a palindrome.
Download Experiment 3

Experiment 4: Sorting Names

  1. Write a Java Program for sorting a given list of names in ascending order.
Download Experiment 4

Experiment 5: Runtime Polymorphism

  1. Write a Java Program that illustrates how runtime polymorphism is achieved.
Download Experiment 5

Experiment 6: Packages Demonstration

  1. Write a Java Program to create and demonstrate packages.
Download Experiment 6

Experiment 7: StringTokenizer Integers

  1. Write a Java Program, using StringTokenizer class.
  2. Read a line of integers and display each integer.
  3. Display the sum of all integers.
Download Experiment 7

Experiment 8: File Information & FileInputStream

  1. Read a file name from the user.
  2. Display whether the file exists.
  3. Display whether the file is readable or writable.
  4. Display the type of file and the length of the file in bytes.
  5. Display the contents using FileInputStream class.
Download Experiment 8

Experiment 9: File Character, Line, Word Count

  1. 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)

  1. Write a Java Program that works as a simple calculator.
  2. Use a grid layout to arrange buttons for digits and + - * / % operations.
  3. Add a text field to display the result.
Download Experiment 10

Experiment 11: Mouse Events

  1. Write a Java Program for handling mouse events.
Download Experiment 11

Experiment 12: Thread Life Cycle

  1. Write a Java Program demonstrating the life cycle of a thread.
Download Experiment 12

Experiment 13: Pie Chart GUI

  1. Write a Java Program that lets users create Pie charts.
  2. Design your own user interface using Swings and AWT.
Download Experiment 13

Experiment 14: Queue with User Defined Exception

  1. Write a Java Program to implement a Queue.
  2. Use user defined Exception Handling.
  3. Make use of throw and throws.
Download Experiment 14

Web Resources

  1. https://www.iitk.ac.in/esc101/05Aug/tutorial/information/resources.html
  2. https://labex.io/skilltrees/java
  3. https://docs.oracle.com/javase/tutorial/index.html
  4. https://introcs.cs.princeton.edu/java/home/

No comments

OBJECT ORIENTED PROGRAMMING USING JAVA LAB

Java Programming Lab Experiments VR-23 2025-26 Java Programming Lab Experiments Experiment 1: Fibonacci Sequence The F...