Lab 3
Lab 3
Lab 3
RollNo:-2200290120104
Sec :- B
Program :-7
Code:-
package mohit;
import java.util.Scanner;
class Number {
private int number;
Number(int num) {
this.number = num;
}
return sum == n;
}
}
scanner.close();
}
}
Output:-
Program :- 8
Code:-
package mohit;
class Room{
int roomno;
String roomtype;
double roomarea;
int ACmachine;
Output:-
Program:-9
Code:-
package mohit;
class Shape {
public void draw() {
}
}
}
public void erase() {System.out.println("CLASS CIRCLE ");
System.out.println(" erase circle ");
}
}
class Triangle extends Shape{
}
class Square extends Shape{
circle.draw();
circle.erase();
square.draw();
square.erase();
triangle.draw();
triangle.erase();
Ouput:-