Answers for "day 13 abstract classes hackerrank solution javascript"

0

day 13 abstract classes hackerrank solution javascript

// day 13 abstract classes hackerrank solution javascript
// Declare your class here.
class MyBook extends Book {
    
    /**   
    *   Class Constructor
    *   
    *   @param title The book's title.
    *   @param author The book's author.
    *   @param price The book's price.
    **/
    // Write your constructor here
    constructor(title, author, price){
        super();
        this.title = title;
        this.author = author;
        this.price = price;
    }
    /**   
    *   Method Name: display
    *   
    *   Print the title, author, and price in the specified format.
    **/
    // Write your method here
    display() {
        console.log(`Title: ${this.title}`);
        console.log(`Author: ${this.author}`);
        console.log(`Price: ${this.price}`);
    }
// End class
}
Posted by: Guest on December-27-2021

Code answers related to "day 13 abstract classes hackerrank solution javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language