0% found this document useful (0 votes)
14 views

OBJECT-ORIENTED-PROGRAMMING-THROUGH-JAVA-LAB

Uploaded by

Gopi Krishna
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)
14 views

OBJECT-ORIENTED-PROGRAMMING-THROUGH-JAVA-LAB

Uploaded by

Gopi Krishna
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

MLR Institute of Technology Autonomous)

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.

2. Understand the use of different exception handling mechanisms and concept of


multithreading for robust and efficient application development.

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.

b. Write a java program to multiply two given matrices

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-4 OVERLOADING & OVERRIDING


a. Write a java program to implement method overloading and constructors overloading.

b. Write a java program to implement method overriding.

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.

B.Tech Academic Regulations – AR22


MLR Institute of Technology Autonomous)
R
2
2
b. Write a program to give example for multiple inheritance in Java.

WEEK-7 EXCEPTION HANDLING


a. Write a program that reads two numbers Num1 and Num2. If Num1 and Num2 were not
integers, the program would throw a Number Format Exception. If Num2 were zero, the
program would throw an Arithmetic Exception Display the exception..

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-9 MULTI THREADING


a. 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

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.

a. Delete a given element from the above list.

b. Display the contents of the list after deletion

WEEK-12 CONNECTING TO DATABASE


a. Write a java program that connects to a database using JDBC and does add, delete, modify and
retrieve operations.

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

3. Bruce Eckel, “Thinking in Java”, Pearson Education, 4th Edition,2006.

4. Sachin Malhotra, Saurabh Chaudhary, “Programming in Java”, Oxford University Press, 5th
Edition, 2010.

B.Tech Academic Regulations – AR22

You might also like