Guest User

Untitled

a guest
Jun 24th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. package pkgday3;
  2.  
  3. public class Q6
  4. {
  5. int productID=101;
  6. String name="Fan";
  7. int categoryID;
  8. double unitPrice=60;
  9. public static void main(String[] args) {
  10. ElectricalProducts e = new ElectricalProducts();
  11. e.display();
  12. e.modify();
  13. e.display();
  14. }
  15.  
  16. }
  17. class ElectricalProducts extends Q6{
  18. double voltageRange;
  19. double wattage=9;
  20. void modify(){
  21. this.wattage=12;
  22. this.unitPrice=50;
  23. }
  24. void display(){
  25. System.out.println("Details: "+this.wattage+ " "+this.unitPrice);
  26. }
  27. }
Add Comment
Please, Sign In to add comment