DR-23 Syllabus for CSE (AI & ML) , DIET
DADI INSTITUTE OF ENGINEERING &TECHNOLOGY
(AN AUTONOMOUS INSTITUTE)
(Approved by A.I.C.T.E., New Delhi & Permanently Affiliated to JNTUGV)
Accredited by NAAC with ‘A’ Grade and Registered u/s 2(f) & 12(B) of UGC Act
An ISO 9001:2015, ISO 14001:2015 & ISO 45001:2018 Certified [Link]-16, Anakapalle – 531002, Visakhapatnam
Object-Oriented Programming through L T P C
II Year I Semester
JAVA Lab 0 0 3 1.5
Course Objectives:
The aim of this course is to
● Practice object oriented programming in the Java programming language
● implement Classes, Objects, Methods, Inheritance, Exception, Runtime Polymorphism,
User defined Exception handling mechanism
● Illustrate inheritance, Exception handling mechanism, JDBC connectivity
● Construct Threads, Event Handling, implement packages, Java FX GUI
Experiments covering the Topics:
● Object Oriented Programming fundamentals- data types, control structures
● Classes, methods, objects, Inheritance, polymorphism,
● Exception handling, Threads, Packages, Interfaces
● Files, I/O streams, JavaFX GUI
Sample Experiments:
Exercise – 1:
1. Write a JAVA program to display default value of all primitive data type of JAVA
2. Write a java program that display the roots of a quadratic equation ax2+bx=0.
Calculate the discriminate D and basing on value of D, describe the nature of root.
Exercise - 2
1. Write a JAVA program to search for an element in a given list of elements using binary
search mechanism.
2. Write a JAVA program to sort for an element in a given list of elements using bubble sort
3. Write a JAVA program using String Buffer to delete, remove character.
Exercise - 3
1. Write a JAVA program to implement class mechanism. Create a class, methods and
invoke them inside main method.
2. Write a JAVA program implement method overloading.
3. Write a JAVA program to implement constructor.
DR-23 Syllabus for CSE (AI & ML) , DIET
DADI INSTITUTE OF ENGINEERING &TECHNOLOGY
(AN AUTONOMOUS INSTITUTE)
(Approved by A.I.C.T.E., New Delhi & Permanently Affiliated to JNTUGV)
Accredited by NAAC with ‘A’ Grade and Registered u/s 2(f) & 12(B) of UGC Act
An ISO 9001:2015, ISO 14001:2015 & ISO 45001:2018 Certified [Link]-16, Anakapalle – 531002, Visakhapatnam
4. Write a JAVA program to implement constructor overloading.
Exercise – 4
1. Write a JAVA program to implement Single Inheritance
2. Write a JAVA program to implement multi level Inheritance
3. Write a JAVA program for abstract class to find areas of different shapes
Exercise – 5
1. Write a JAVA program give example for “super” keyword.
2. Write a JAVA program to implement Interface. What kind of Inheritance can be
achieved?
3. Write a JAVA program that implements Runtime polymorphism
Exercise - 6
1. Write a JAVA program that describes exception handling mechanism
2. Write a JAVA program Illustrating Multiple catch clauses
3. Write a JAVA program for creation of Java Built-in Exceptions
4. Write a JAVA program for creation of User Defined Exception
Exercise - 7
1. Write a JAVA program that creates threads by extending Thread class. First thread
display “Good Morning “every 1 sec, the second thread displays “Hello “every 2
seconds and the third display “Welcome” every 3 seconds, (Repeat the same by
implementing Runnable)
2. Write a program illustrating is Alive and join ()
3. Write a Program illustrating Daemon Threads.
4. Write a JAVA program Producer Consumer Problem
Exercise – 8
1. Write a JAVA program that import and use the user defined packages
2. Without writing any code, build a GUI that display text in label and image in an
ImageView (use JavaFX)
3. Build a Tip Calculator app using several JavaFX components and learn how to
respond to user interactions with the GUI
Exercise – 9
1. Write a java program that connects to a database using JDBC
2. Write a java program to connect to a database using JDBC and insert values into it.
DR-23 Syllabus for CSE (AI & ML) , DIET
DADI INSTITUTE OF ENGINEERING &TECHNOLOGY
(AN AUTONOMOUS INSTITUTE)
(Approved by A.I.C.T.E., New Delhi & Permanently Affiliated to JNTUGV)
Accredited by NAAC with ‘A’ Grade and Registered u/s 2(f) & 12(B) of UGC Act
An ISO 9001:2015, ISO 14001:2015 & ISO 45001:2018 Certified [Link]-16, Anakapalle – 531002, Visakhapatnam
3. Write a java program to connect to a database using JDBC and delete values from it
******