0% found this document useful (0 votes)
2 views3 pages

Object Oriented Programming Through Java Lab

The document outlines a series of exercises for practicing Java programming, covering topics such as primitive data types, quadratic equations, searching and sorting algorithms, class mechanisms, inheritance, interfaces, exception handling, user-defined packages, and JDBC database connectivity. Each exercise includes specific tasks such as writing programs for various functionalities like method overloading, exception handling, and database operations. The exercises are designed to enhance understanding of core Java concepts and practical application.

Uploaded by

0david7991
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Object Oriented Programming Through Java Lab

The document outlines a series of exercises for practicing Java programming, covering topics such as primitive data types, quadratic equations, searching and sorting algorithms, class mechanisms, inheritance, interfaces, exception handling, user-defined packages, and JDBC database connectivity. Each exercise includes specific tasks such as writing programs for various functionalities like method overloading, exception handling, and database operations. The exercises are designed to enhance understanding of core Java concepts and practical application.

Uploaded by

0david7991
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Exercise – 1:

a) Write a JAVA program to display default value of all primitive data type of JAVA

b) Write a java program that display the roots of a quadratic equation ax2+bx=0. Calculate
thediscriminate D and basing on value of D, describe the nature of root.
Exercise - 2
a) Write a JAVA program to search for an element in a given list of elements using
binarysearch mechanism.
b) Write a JAVA program to sort for an element in a given list of elements using bubble sort

c) Write a JAVA program using String Buffer to delete, remove character.


Exercise - 3
a) Write a JAVA program to implement class mechanism. Create a class, methods and
invokethem inside main method.
b) Write a JAVA program implement method overloading.

c) Write a JAVA program to implement constructor.

d) Write a JAVA program to implement constructor overloading.


Exercise - 4
a) Write a JAVA program to implement Single Inheritance

b) Write a JAVA program to implement multi level Inheritance

c) Write a JAVA program for abstract class to find areas of different shapes

Exercise - 5
a) Write a JAVA program give example for “super” keyword.

b) Write a JAVA program to implement Interface. What kind of Inheritance can be achieved?

c) Write a JAVA program that implements Runtime polymorphism


Exercise - 6
a) Write a JAVA program that describes exception handling mechanism

b) Write a JAVA program Illustrating Multiple catch clauses

c) Write a JAVA program for creation of Java Built-in Exceptions

d) Write a JAVA program for creation of User Defined Exception


Exercise – 7
Write a JAVA program that import and use the user defined packages
Exercise – 8
a) Write a java program that connects to a database using JDBC
b) Write a java program to connect to a database using JDBC and insert values into it.
c) Write a java program to connect to a database using JDBC and delete values from it

You might also like