Object Oriented Programming - Lab
Object Oriented Programming - Lab
Course Outcome:
List of Practical:
P2: Write a program to perform arithmetic and bitwise operations in a single source program without object
creation.
P3: Write a program to perform arithmetic and bitwise operations by creating individual methods and
classes than create an object to execute the individual methods of each operation.
P4: Write a java program to display the employee details using Scanner class.
P5: Write a Java program that prints all real solutions to the quadratic equation ax2+bx+c = 0. Read in a, b,
c and use the quadratic formula. If the discriminate b2-4ac is negative, display a message stating that there
are no real solutions?
P6: 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?
P7: Write a Java program that prompts the user for an integer and then prints out all the prime numbers up
to that Integer?
P9: Write a Java program for sorting a given list of names in ascending order?
P10: Write a java program for Method overloading and Constructor overloading.
P17: Write a Java program that displays the number of characters, lines and words in a text?
P18: Write a Java program that checks whether a given string is a palindrome or not. Ex: MADAM is a
palindrome?
P19: Write a Java program that reads a line of integers and then displays each integer and the sum of all
integers. (Use StringTokenizer class)?
P20: Write a java program for creating single try block with multiple catch blocks.
P21: write a program for multiple try blocks and multiple catch blocks including finally.
P23: Write a java program for producer and consumer problem using Threads.
P24: Write a java program that implements a multi-thread application that has three threads. First thread
generates random integer every 1 second and if the value is even, second thread computes the square of
the number and prints. If the value is odd, the third thread will print the value of cube of the number.
P25: write a program to create dynamic array using ArrayList class and the print the contents of the array
object.
P26: Write programs to implement add, search and remove operation on ArrayList object.