Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
4 views5 pages

JAVA Lab Plan With Dates

Important Topics6

Uploaded by

Anil Kumar B
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)
4 views5 pages

JAVA Lab Plan With Dates

Important Topics6

Uploaded by

Anil Kumar B
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/ 5

VFSTR::Hyderabad B.

Tech - CSE - 2nd Year - B Section


Lecture Plan for the Subject : OBJECT ORIENTED PROGRAMMING THROUGH JAVA Lab
S.No Date Period Program Teaching AIDS
1. There is a telecommunication company called “Powered Air” who have approached
you to build their Interactive Voice Response (IVR) system. write a Java program.
1 16-07-2025 3 & 4 2. Create a class Rectangle. The class has attributes length and width. It should have ICT, PPT, Online Java Compiler for execution/ Eclipse
methods that calculate the perimeter and area of the rectangle. It should have read
Attributes method to read length and width from user.
3. Implement a Java Program that reads a line of integers, and then displays each
integer, and the sum of all the integers (use String Tokenizer class).
2 23-07-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
4. Implement a java program to print all tokens of a string on the bases of multiple
separators (use String Tokenizer class).
5. Using inheritance, one class can acquire the properties of others. Consider a class
Animal that has only one method “walk”. Next, create a Bird class that also has a fl y
method. Finally, create a bird object that can both fly and walk.
6. Using inheritance, Write the following code in your editor :
3 30-07-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
1. A class named Arithmetic with a method named “add” that takes integers as
parameters and returns an integer denoting their sum.
2. A class named Adder that inherits from a super class named Arithmetic.
Note: Your classes should not be Public.
7. When a subclass inherits from a super class, it also inherits its methods; however, it
can also override the super class methods (as well as declare and implement new ones).
Consider the Sports class having methods get Name()[which returns name of sport] and
get Number Of Team Members()[which returns no of team members] create a Soccer
class that inherits from the Sports class. We can override get Name method and return
a different subclass-specific.
4 06-08-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
8. String and override getNumberOfTeamMembers method and return no of team
members Implement a java program to create an abstract class named Shape that
contains an empty method named number Of Sides ( ).Provide three classes named
Trapezoid, Triangle and Hexagon such that each one of the classes extends the class
Shape. Each one of the classes contains only the method number Of Sides ( ) that shows
the number of sides in the given geometrical figures.
9. You are given an interface Advanced Arithmetic which contains a method signature
int divisor_sum(int n). You need to write a class called My Calculator which implements
the interface. divisor_sum function just takes an integer as input and return the sum of
all its divisors. For example divisors of 6 are 1, 2, 3 and 6, so divisor_sum should return
12. The value of n will be at most 1000.
5 13-08-2025 3 & 4 10. Implement a Java program for the following ICT, PPT, Online Java Compiler for execution/ Eclipse
a) Creation of simple package.
b) Accessing a package.
11. Implement a Java program to read two numbers a,b from user and perform division
a/b,if the user passes b value as zero, handle the exception using try and catch
otherwise display the result.
12. Create a class called Customer with data members account_number, balance
(initialize with 10000), and member functions print(), deposit(), and withdraw(). Print
method display account number and balance. If withdraw amount is less than current
balance while withdrawing, throw an exception “In Suffi cient Funds”. If the input is 1
6 20-08-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
do print. If the input is 2 withdraw (). If the input is 3 deposit. If the input is 4 terminate
program.
13. Implement a Java program which accepts age as input from the user and throws an
exception “Not Eligible to Vote” when age is <=18 otherwise print “Eligible to Vote”.
7 27-08-2025 3 & 4 Vinayaka Chavathi Holiday Holiday
1. Print in Order
Suppose we have a class:
public class Foo {
public void fi rst() { print(“fi rst”); }
public void second() { print(“second”); }
public void third() { print(“third”); }
}
The same instance of Food will be passed to three different threads. Thread A will call
first(), thread B will call second(), and thread C will call third(). Design a mechanism and
modify the program to ensure that second() is executed after first(), and third() is
executed after second().
8 03-09-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
Note: We do not know how the threads will be scheduled in the operating system, even
though the numbers in the input seem to imply the ordering. The input format you see
is mainly to ensure our tests’ comprehensiveness.
Example 1: Input: nums = [1,2,3] Output: “first second third”
Explanation: There are three threads being fi red asynchronously. The input [1,2,3]
means
thread A calls first(), thread B calls second(), and thread C calls third(). “first second
third” is the correct output.
Example 2: Input: nums = [1,3,2] Output: “first second third”
Explanation: The input [1,3,2] means thread A calls first(), thread B calls third(), and
thread c calls second(). “first second third” is the correct output.

9 10-09-2025 3 & 4 Module 1-Target 4 Holiday


2. Flood Fill:
An image is represented by an m x n integer grid image where image[i][j] represents the
pixel value of the image. You are also given three integers sr, sc, and color. You should
perform a flood fill on the image starting from the pixel image[sr][sc]. To perform a
flood fill, consider the starting pixel, plus any pixels connected 4-directionally to the
starting pixel of the same color as the starting pixel, plus any pixels connected 4-
directionally to those pixels (also with the same color), and so on. Replace the color of
all of the aforementioned pixels with color.
Return the modified image after performing the flood fill.
111222
110220
101201
Example 1:
10 17-09-2025 3 & 4 Input: image = [[1,1,1],[1,1,0],[1,0,1]], sr = 1, sc = 1, color = 2 ICT, PPT, Online Java Compiler for execution/ Eclipse
Output: [[2,2,2],[2,2,0],[2,0,1]]
Explanation: From the centre of the image with position (sr, sc) = (1, 1) (i.e., the red
pixel),
all pixels connected by a path of the same color as the starting pixel (i.e., the blue
pixels) are
colored with the new color.
Note the bottom corner is not coloured 2, because it is not 4-directionally connected to
the
starting pixel.
Example 2:
Input: image = [[0,0,0],[0,0,0]], sr = 0, sc = 0, color = 0
Output: [[0,0,0],[0,0,0]]
Explanation: Starting pixel is already colored 0, so no changes are made to the image.
3. Count words in a given string
The input parameter is a list of strings representing lines of text.
Count how often the word occurs in the text.
If the word “kitten” occurred in a text 23 times, then its entry would be “kitten - 23\n”.
11 24-09-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
Return statistics as a String containing all the entries. Omit all words which contain less
than 4 letters and appear less than 10 (the words which are too small or to rare) The
entries in the resulting String should be also sorted by their amount and then in
alphabetical order if it is needed.
12 01-10-2025 3 & 4 Mahanavami Holiday Holiday
4. Implement a Java program for handling mouse events when the mouse entered,
13 08-10-2025 3 & 4 exited, clicked, pressed, released, dragged and moved in the client area. ICT, PPT, Online Java Compiler for execution/ Eclipse
5. Implement a Java program for handling key events when the key board is pressed,
released, typed.

6. Implement a Java swing program that reads two numbers from two separate text
fields and display sum of two numbers in third text fi eld when button “add” is pressed.

14 15-10-2025 3 & 4 7. Implement a Java program to design student registration form using Swing Controls. ICT, PPT, Online Java Compiler for execution/ Eclipse
The form which having the following fields and button “save”. Form Fields are: Name,
RNO, Mail id, Gender, Branch, and Address.

8. Implement a java program using swings to design a multiple choice question having
three options (use radio button) ,display the message using dialog box “Your answer is
15 22-10-2025 3 & 4 ICT, PPT, Online Java Compiler for execution/ Eclipse
wrong” if the user selects wrong option otherwise display ,”Your answer is correct.”

16 29-10-2025 3 & 4 Module 2-Target 1 Holiday


17 05-11-2025 3 & 4 Guru Nanak Jayanthi Holiday Holiday
18 12-11-2025 3 & 4 Revision Holiday

You might also like