Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pkgday3;
- public class Q6
- {
- int productID=101;
- String name="Fan";
- int categoryID;
- double unitPrice=60;
- public static void main(String[] args) {
- ElectricalProducts e = new ElectricalProducts();
- e.display();
- e.modify();
- e.display();
- }
- }
- class ElectricalProducts extends Q6{
- double voltageRange;
- double wattage=9;
- void modify(){
- this.wattage=12;
- this.unitPrice=50;
- }
- void display(){
- System.out.println("Details: "+this.wattage+ " "+this.unitPrice);
- }
- }
Add Comment
Please, Sign In to add comment