OBJECT-ORIENTED-PROGRAMMING-THROUGH-JAVA-LAB
OBJECT-ORIENTED-PROGRAMMING-THROUGH-JAVA-LAB
R
2
2
OBJECT ORIENTED PROGRAMMING THROUGH JAVA LAB
II B.Tech - I Semester –IT
Course Code Category Hours / Week Credits Maximum Marks
L T P C CIE SEE Total
A6IT03 PCC
0 0 3 1.5 40 60 100
COURSE OUTCOMES:
1. Implement Object Oriented programming concept using basic syntaxes of control Structures,
strings and function for developing skills of logic building activity.
3. Understand and implement concepts on file streams and operations in java programming for
a a given application programs.
4. Develop java application to interact with database by using relevant software component
(JDBC Driver).
LIST OF EXPERIMENTS
WEEK-1 JAVABASICS
a. 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.
b. The Fibonacci sequence is defined by the following rule. The first two values in the sequence
are 1 and 1. Every subsequent value is the sum of the two values preceding it. Write a java
program that uses both recursive and non-recursive functions.
WEEK-2 ARRAYS
a. Write a java program to sort given list of integers in ascending order.
WEEK-3 STRINGS
a. Write a java program to check whether a given string is palindrome.
b. a. Write a java program for sorting a given list of names in ascending order.
WEEK-5 INHERITANCE
a. Write a java program to create an abstract class named Shape that contains two integers and
an empty method named print Area (). Provide three classes named Rectangle, Triangle and
Circle such that each one of the classes extends the class Shape. Each one of the classes
contains only the method print Area () that prints the area of the given shape.
WEEK-6 INTERFACES
a. Write a program to create interface A in this interface we have two method meth1 and meth2.
Implements this interface in another class named MyClass.
I/O STREAMS
WEEK-8
a. Write a java program that reads a file name from the user, and then displays information about
whether the file exists, whether the file is readable, whether the file is writable, the type of file
and the length of the file in bytes.
b. Write a java program that displays the number of characters, lines and words in a text file.
WEEK-10 GENERICS
a. Write a Java program to swap two different types of data using Generics.
b. Write a Java program to find maximum and minimum of two different types of data using
Generics
WEEK-11 COLLECTIONS
Create a linked list of elements.
TEXT BOOKS:
1. P. J. Deitel, H. M. Deitel, “Java for Programmers”, Pearson Education, PHI, 4th Edition,2007.
2. P. Radha Krishna, “Object Oriented Programming through Java”, Universities Press, 2nd
Edition,2007
4. Sachin Malhotra, Saurabh Chaudhary, “Programming in Java”, Oxford University Press, 5th
Edition, 2010.