Guest User

Untitled

a guest
Jun 24th, 2018
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. package pkgday3;
  2.  
  3. public class Q7 {
  4. int bookID=101;
  5. String title="Gelvin";
  6. String author ="abc";
  7. double price=60;
  8. public static void main(String[] args) {
  9. Periodical e = new Periodical();
  10. e.display();
  11. e.modify();
  12. e.display();
  13. }
  14. }
  15. class Periodical extends Q7{
  16. String period = "Weekly";
  17. void modify(){
  18. this.period="Monthly";
  19. this.price=50;
  20. }
  21. void display(){
  22. System.out.println("Details: "+this.period+ " "+this.price);
  23. }
  24. }
Add Comment
Please, Sign In to add comment