0% found this document useful (0 votes)
3 views4 pages

JAVA LIST OF EXPERIMENTS (1)

The document outlines a practical list for an Object Oriented Programming with Java lab course (BCS-452) for the academic year 2023-24. It includes various programming tasks across multiple units, covering topics like basic Java programming, exception handling, multithreading, new Java features, Java Collections Framework, and Spring Framework. Each task is designed to enhance understanding and application of Java concepts through hands-on programming exercises.
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)
3 views4 pages

JAVA LIST OF EXPERIMENTS (1)

The document outlines a practical list for an Object Oriented Programming with Java lab course (BCS-452) for the academic year 2023-24. It includes various programming tasks across multiple units, covering topics like basic Java programming, exception handling, multithreading, new Java features, Java Collections Framework, and Spring Framework. Each task is designed to enhance understanding and application of Java concepts through hands-on programming exercises.
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/ 4

Department of Computer Science

PRACTICAL LIST
OBJECT ORIENTED PROGRAMMING WITH JAVA LAB
BCS-452
2023-24
S.No
Program Date Sign
.
Unit 1: Introduction, Programming Structures in Java, Object Oriented
Programming, Packages
Write a Java program to insert 3 numbers from keyboard and find
1
out greater number among 3 numbers.
Write a Java program to count total number of odd numbers between
2
1 -100 and display sum of them.
Write a Java Program to Find largest and smallest number in an
3 array in java.

Program to count number of words in given string, to reverse the


4 string and check whether it is palindrome or not?

Write a Java program to find out the sum of command line


5 arguments.

Write a Java program to create a class “SimpleObject” and display


6
message by using constructor of this class.
Write a Java program to create class Number with only one private
instance variable as a double primitive type, include the following
methods isZero(), isPositive(), isNegative( ), isOdd( ), isEven( ),
7
isPrime(), isAmstrong() in this class and all above methods should
return boolean primitive type like for isPositive() should return
“Positive = True”.
Write a Java program to create a Room class, the attributes of this
class is roomno, roomtype, roomarea and ACmachine. In this class
8 the member functions are setData and displayData. Use member
function to set data and display that data using displayData()
method.
Department of Computer Science
Write a Java program to create a class named Shape and create three
sub classes Circle, Triangle and Square, each class has two-member
9
function named draw () and erase (). Implement this concept using
polymorphism.
Write a Java program to create a class Employee with a method
called calculateSalary(). Create two subclasses Manager and
10
Programmer. In each subclass, override the calculateSalary() method
to calculate and return the salary based on their specific roles.
Write a Java program to implement the concept of method
11
overloading and method overriding.And Abstract Class.
Unit 2: Exception Handling, Input /Output Basics, Multithreading
Create a class Employee having members as follows:
private int empNo
private String empName
private int empBasic
Parameterized constructor to initialize members.
12 Getter methods for all instance variables
Create a class WriteEmployee having main method. Ask user to
enter details of an employee and set them in an Employee object.
Store details of this object in a file emp.txt. Read employee details
from the file and display those details.

Write a Java program to create a text file in the path c:/Java/abc.txt


and check whether that file exists or not. Using the command exists
13
(), isDirectory(), isFile(), getName() and getAbsolutePath().

Implement three classes: Storage, Counter and Printer


The Storage class should store an integer.
The Counter class should create a thread and starts counting from 0
(0,1,2, 3 ...) and stores each value in the Storage class.
14 The Printer class should create a thread that keeps reading the value
in the Storage class and printing it.
Write a program that creates an instance of the Storage class and set
up a Counter and Printer object to operate on it.

15 Create a class MyThread derived from Thread class and override the
run method. Create a class ThreadDemo having main method. Create
Department of Computer Science
2 objects of MyThread class and observe the behavior of threads.

Modify the above to create MyThread class by implementing


16
Runnable interface and observe the behavior of threads.
WAP to Assign different priorities to the 2 threads and observe the
17
behaviour
Write a Java program to create a producer-consumer scenario using
18
the wait () and notify () methods for thread synchronization.
19 WAP to implement deadlock in Java (Content Beyond Syllabus)
Unit 3: Java New Features
WAP to implement the following new features in Java.
(a) Functional Interface
(b) Lambda Expression: Write a Java program to implement a
lambda expression to check if a given string is empty.
20
(c) Method References:
(d) Default and Static Method in Interface
(e) Inner Class

21 WAP to implement different types of Annotations in JAVA.


22 WAP to filter data by using stream.
WAP to Traversing the array elements and to sum the elements
23 using For-each loop.

WAP to implement Base64 Encoding and Decoding.


24
WAP to implement Local Variable Type Inference.
25
26 WAP to implement Sealed Class.
27 WAP to implement Text Blocks and Records.
UNIT 4: Java Collections Framework
Write a Java program to insert an element into the array list at the
28 first position.

29 Write a Java program to iterate a linked list in reverse order.


Write a Java program to append the specified element to the end of a
30
hash set.
31 Write a Java program to add all the elements of a specified to
Department of Computer Science
another tree set. tree set.
Write a Java program to count the number of key-value (size)
32
mappings in a map.
33 Write a Java program to search for a value in a Tree Map.
34 Write a Java program to Demonstrate Iterator.
35 WAP Convert an Iterable to Collection in Java.
Unit 5: Spring Framework, Spring Boot
Create industry-oriented application using Spring Framework.
36
37 Test RESTful web services using Spring Boot.
Test Frontend web application with Spring Boot
38

You might also like