Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //https://www.hackerrank.com/challenges/30-abstract-classes/problem
- //Write MyBook class
- class MyBook : Book
- {
- protected int price;
- public MyBook(String title, String author, int price) : base(title, author){
- this.price = price;
- }
- public override void display(){
- Console.WriteLine("Title: " + title);
- Console.WriteLine("Author: " + author);
- Console.WriteLine("Price: " + price);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement