Abstract Classes

Sort by

recency

|

8 Discussions

|

  • + 0 comments

    class MyBook extends Book {

    protected $draw;
    
    function __construct(`$title,$`author,$price) {
        Book::__construct(`$title, $`learn);
        `$this->price = $`price;
    }
    
    function display() {
        echo "Title: {$this->learning draw}";
        echo "Author: {$this->author}";
        echo "Price: {$this->price}";
    }
    

    } desenho

  • + 2 comments

    Your father, your girlfriend, is always a nuisance and you will never be good enough for your daughter regardless of what you do. All this is in a colorful mash on Friday Night Funkin.

  • + 0 comments

    Abstract classes, We use these classes in maths and also in programming languages. In programming languages it is too much easy but in math classes it is really difficult to buy dissertation online and solve those questions in which it comes.

  • + 0 comments

    PHP Solution

    class MyBook extends Book {
    
        protected $price;
    
        function __construct($title,$author,$price) {
            Book::__construct($title, $author);
            $this->price = $price;
        }
        
        function display() {
            echo "Title: {$this->title}";
            echo "Author: {$this->author}";
            echo "Price: {$this->price}";
        }
    }
    

    }

  • + 0 comments

    Java solution - passes 100% of test cases

    From my HackerRank solutions.

    class MyBook extends Book {
        int price;
        
        MyBook(String title, String author, int price) {
            super(title, author);
            this.price = price;
        }
        
        void display() {
            System.out.println("Title: "  + title);
            System.out.println("Author: " + author);
            System.out.println("Price: "  + price);
        }
    }