문서 편집 권한이 없습니다. 다음 이유를 확인해주세요: 요청한 명령은 다음 권한을 가진 사용자에게 제한됩니다: 사용자. 문서의 원본을 보거나 복사할 수 있습니다. ==개요== ;<nowiki>Day 13: Abstract Classes</nowiki> * https://www.hackerrank.com/challenges/30-abstract-classes/problem {{HR30 헤더}} {{HR30 10-19}} |} ==Java== {{참고|HR30 Day 13: Abstract Classes/Java}} <syntaxhighlight lang='Java'> class MyBook extends Book { int price; MyBook(String title, String author, int price) { super(title, author); this.price = price; } public void display() { System.out.printf("Title: %s\n", this.title); System.out.printf("Author: %s\n", this.author); System.out.printf("Price: %d\n", this.price); } } </syntaxhighlight> ==PHP== {{참고|HR30 Day 13: Abstract Classes/PHP}} <syntaxhighlight lang='php'> class MyBook extends Book { protected $price; function __construct($title, $author, $price) { parent::__construct(trim($title), trim($author)); $this->price = $price; } function display() { echo 'Title: ' . $this->title . "\n"; echo 'Author: ' . $this->author . "\n"; echo 'Price: ' . $this->price . "\n"; } } </syntaxhighlight> ==Python== {{참고|HR30 Day 13: Abstract Classes/Python}} <syntaxhighlight lang='python'> #Write MyBook class class MyBook(Book): def __init__(self,title,author,price): super().__init__(title,author) self.price = price def display(self): print( 'Title:',self.title ) print( 'Author:', self.author ) print( 'Price:', self.price ) </syntaxhighlight> 이 문서에서 사용한 틀: 틀:Ed (원본 보기) 틀:HR30 10-19 (원본 보기) 틀:HR30 헤더 (원본 보기) 틀:언어아이콘 (원본 보기) 틀:언어이미지 (원본 보기) 틀:참고 (원본 보기) HR30 Day 13: Abstract Classes 문서로 돌아갑니다.