Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
125 views
4 pages
Lab Programs 7 & 8
Java
Uploaded by
Madhu
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download
Save
Save Lab programs 7 & 8 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
125 views
4 pages
Lab Programs 7 & 8
Java
Uploaded by
Madhu
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Carousel Previous
Carousel Next
Download
Save
Save Lab programs 7 & 8 For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 4
Search
Fullscreen
Lab Program 7 Develop a JAVA program to create an interface Resizable with methods resizeWidth(int width) and resizeHeight(int height) that allow an object to be resized. Create a class Rectangle that implements the Resizable interface and implements the resize methods. AIN: To write a Java program to create a class Rectangle that implements the Resizable interface and implements the resize methods. interface Resizable { void resizeWidth(int width); void resizeHeight(int height); } class Rectangle implements Resizable { private int width; private int height; public Rectangle(int width, int height) s.width = width; this.height = height; - peDRIELald ‘resizemiaen (dine width) this.width = width; + public void resizeHeight (int height) < + public int getWwidth() { + this.height = height; return width; public int getHeight () {return height; } public class ResizableDemo public static void main(String{] args) © pessoa reccarnie «toe nacserielum, ils system, out. pris rectangle.getwidth() + An("Original Rectangle: Width=" + , Height=" + rectangle.getHeight ()); rectangle. resizeWidth(15); rectangle. resizeHeight(30); System. out.println("Resized Rectangle: Width=" + rectangle.getWidth() +", Height=" + rectangle.getHeight()); + , output: Original Rectangle: Width=10, Height=20 Resized Rectangle: Width=15, ‘Heigh RESULT: Thus, the program to create a class Rectangle that implements ‘the Resizable interface and implements the resize methods has been executed successfully and the output was verified.Lab Program 8 Develop a JAVA progran to create an outer class with a function display. Create another class inside the outer class named inner with a function called display and call the two functions in the main class. AIM: To write a Java program to create an outer class with a function display. Create another class inside the outer class named inner with a function called display and call the two functions in the main class. class OuterClass { void display() { System.out.printIn("This is the display method of the outer class. class InnerClass void display() { System.out.printIn("This is the display method of the dnmer class"); } + public class MainClass { public static void main(String{] args) OuterClass outer = new uterClass(); OuterClass.InnerClass inner = outer.new InnerClass(); outer.display(); // Call the display method of the outer class p meradisplayl)i 1/ Call the display method at the Amer: class + output: This is the display method of the outer class. This is the display method of the inner class.RESULT: Thus, the program to write a Java program to create an outer class with a function display and to Create another class inside the outer class named inner with a function called display and call the two functions in the main class has been executed successfully and the output was verified.
You might also like
Java Programming LAB RECORD PDF
PDF
No ratings yet
Java Programming LAB RECORD PDF
21 pages
Me 3rd Sem JAVA
PDF
No ratings yet
Me 3rd Sem JAVA
15 pages
BCSL-043 Lab Record
PDF
67% (3)
BCSL-043 Lab Record
21 pages
Java MCSL 025 Solved
PDF
100% (2)
Java MCSL 025 Solved
42 pages
Java Record
PDF
No ratings yet
Java Record
60 pages
Program 8
PDF
No ratings yet
Program 8
1 page
EXPERIMENT Web Tech Lab KARTHIK
PDF
No ratings yet
EXPERIMENT Web Tech Lab KARTHIK
25 pages
Java Lab 4
PDF
No ratings yet
Java Lab 4
10 pages
Lab Manual#
PDF
No ratings yet
Lab Manual#
27 pages
Doc1 5
PDF
No ratings yet
Doc1 5
13 pages
Java - Manual 1to13
PDF
No ratings yet
Java - Manual 1to13
20 pages
Java 3 Shami
PDF
No ratings yet
Java 3 Shami
11 pages
Program 7,8,9 JAVA
PDF
No ratings yet
Program 7,8,9 JAVA
6 pages
WT 8
PDF
No ratings yet
WT 8
6 pages
BCS304-Module 3 Notes (Sowmya)
PDF
100% (1)
BCS304-Module 3 Notes (Sowmya)
6 pages
COSC212 - Java Programming (Weekday)
PDF
No ratings yet
COSC212 - Java Programming (Weekday)
5 pages
Programming Experiments - OOP in Java
PDF
No ratings yet
Programming Experiments - OOP in Java
2 pages
Sheet 3 - Nested Classes
PDF
No ratings yet
Sheet 3 - Nested Classes
2 pages
Java Labprogram 7
PDF
No ratings yet
Java Labprogram 7
3 pages
Java CH8 Solutions
PDF
No ratings yet
Java CH8 Solutions
4 pages
OOPJ BCS306A Odd 2023 - Lab Programs
PDF
No ratings yet
OOPJ BCS306A Odd 2023 - Lab Programs
2 pages
Program of Ootobject
PDF
No ratings yet
Program of Ootobject
34 pages
Joy 6
PDF
No ratings yet
Joy 6
16 pages
2csedssyll 20 24
PDF
No ratings yet
2csedssyll 20 24
5 pages
WAP To Find Out Factorial of A Number Through Recursion.: Program-1
PDF
No ratings yet
WAP To Find Out Factorial of A Number Through Recursion.: Program-1
19 pages
Java Programs 7 To 12
PDF
No ratings yet
Java Programs 7 To 12
16 pages
Java File
PDF
No ratings yet
Java File
75 pages
Java Lab Record Final For Pint
PDF
No ratings yet
Java Lab Record Final For Pint
59 pages
APP Assignment
PDF
No ratings yet
APP Assignment
18 pages
CH7 Programs
PDF
No ratings yet
CH7 Programs
10 pages
Module 4&5
PDF
No ratings yet
Module 4&5
6 pages
OOPS - JAVA - Lab Programs
PDF
No ratings yet
OOPS - JAVA - Lab Programs
2 pages
Java Lab Programs
PDF
No ratings yet
Java Lab Programs
22 pages
Java Lab PDF
PDF
No ratings yet
Java Lab PDF
21 pages
Java Record
PDF
No ratings yet
Java Record
96 pages
Solving Simple Problems Using,: Java Programming Lab
PDF
No ratings yet
Solving Simple Problems Using,: Java Programming Lab
44 pages
COMPLETE JAVA PROGRAM File
PDF
No ratings yet
COMPLETE JAVA PROGRAM File
40 pages
Java Experiments1-41
PDF
No ratings yet
Java Experiments1-41
64 pages
80M03 Oop
PDF
No ratings yet
80M03 Oop
60 pages
COSC212 - Java Programming (Weekend)
PDF
No ratings yet
COSC212 - Java Programming (Weekend)
5 pages
Javalab
PDF
No ratings yet
Javalab
14 pages
Mukulbedi (Bca4eb) Java
PDF
No ratings yet
Mukulbedi (Bca4eb) Java
37 pages
Java Manual-1
PDF
No ratings yet
Java Manual-1
14 pages
Final Java Lab
PDF
No ratings yet
Final Java Lab
32 pages
Java Programming Lab Lesson Plan - Spring 2025
PDF
No ratings yet
Java Programming Lab Lesson Plan - Spring 2025
16 pages
Employee Processing - Using Class
PDF
No ratings yet
Employee Processing - Using Class
38 pages
Java Lab Prog
PDF
No ratings yet
Java Lab Prog
17 pages
0 - Java Record Work 2020-2023-Semester III
PDF
No ratings yet
0 - Java Record Work 2020-2023-Semester III
25 pages
Lab Record For Java Programming and Introduction of Python Lab (BCE-C657)
PDF
No ratings yet
Lab Record For Java Programming and Introduction of Python Lab (BCE-C657)
29 pages
Lab Manual Java IGNOU Sem 2
PDF
100% (1)
Lab Manual Java IGNOU Sem 2
56 pages
Assignment-2 1. Write A Java Program To Show That Private Member of A Super Class Cannot Be Accessed From Derivedclasses
PDF
No ratings yet
Assignment-2 1. Write A Java Program To Show That Private Member of A Super Class Cannot Be Accessed From Derivedclasses
19 pages
Smallpdf - 2021 11 25 Edited Edited Edited
PDF
No ratings yet
Smallpdf - 2021 11 25 Edited Edited Edited
13 pages
Java Lab Programs Solutions
PDF
No ratings yet
Java Lab Programs Solutions
28 pages
Java Pratical Exam
PDF
No ratings yet
Java Pratical Exam
13 pages
JAVA PROGRAMMING PRACTICAL FILE 2222akash
PDF
No ratings yet
JAVA PROGRAMMING PRACTICAL FILE 2222akash
24 pages
OOPS Concepts
PDF
No ratings yet
OOPS Concepts
33 pages
Java
PDF
No ratings yet
Java
4 pages
Java Lab Manual 1
PDF
No ratings yet
Java Lab Manual 1
15 pages
Operating System
PDF
No ratings yet
Operating System
25 pages
Java Assignment
PDF
No ratings yet
Java Assignment
6 pages
Assignment 2
PDF
No ratings yet
Assignment 2
16 pages
Clean Water and Sanitation
PDF
No ratings yet
Clean Water and Sanitation
13 pages
Ada m5 Part 1 Notes - @vtupadhai
PDF
No ratings yet
Ada m5 Part 1 Notes - @vtupadhai
12 pages
New - Solveathon 2.0 Templete - 1
PDF
No ratings yet
New - Solveathon 2.0 Templete - 1
9 pages
Auv Paper
PDF
No ratings yet
Auv Paper
8 pages
DIGITAL Disgram
PDF
No ratings yet
DIGITAL Disgram
6 pages
Advaya CSE Magazine Article Ideas
PDF
No ratings yet
Advaya CSE Magazine Article Ideas
2 pages
Jarvis Presentation
PDF
No ratings yet
Jarvis Presentation
2 pages
m1 Maths
PDF
No ratings yet
m1 Maths
2 pages