We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • HackerRank Home

    HackerRank

  • |
  • Prepare
  • Certify
  • Compete
  • Hiring developers?
  1. Abstract Classes
  2. Discussions

Abstract Classes

Problem
Submissions
Leaderboard
Discussions

Sort 8 Discussions, By:

recency

Please Login in order to post a comment

  • admproject87
    3 months ago+ 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

    0|
    Permalink
  • Urgot68
    1 year ago+ 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|
    Permalink
  • 5kfnf1de
    2 years ago+ 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|
    Permalink
  • pn801
    4 years ago+ 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|
    Permalink
  • RodneyShag
    6 years ago+ 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);
        }
    }
    
    0|
    Permalink
Load more conversations

Need Help?


View top submissions
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy