“เมื่อวานมีโจรบุกเข้าไปในบ้านของฉัน ทำให้ทุกอย่างกลับหัวกลับหาง และร่อนไปทั่วบ้านเพื่อหาเงิน”
“แย่จัง ดิเอโก คุณทำอะไรลงไป”
"ไม่มีอะไร ฉันเริ่มหัวเราะกับพวกเขาและเข้าร่วมในการค้นหาเงิน ฮ่าฮ่า"
“ในเมื่อบ้านฉันเละเทะไปหมด ฉันหางานของคุณไม่ได้ ฉันต้องจัดการมัน เอาเลย”
4
งาน
Java Core, ระดับ, บทเรียน
OOP: Arrange interfaces
Clothing can (and should, perhaps) be worn, sold, and bought, preferably at a discount. Let's tell the world. We'll add the Movable, Sellable, and Discountable interfaces to the Clothes class, if possible. And then we'll implement their methods (big surprise!).
4
งาน
Java Core, ระดับ, บทเรียน
OOP: Animal inheritance
Next to a mouse, even a goose is enormous. But next to a dragon... In this task, we have geese (Goose class) and dragons (Dragon class). As well as their ancestors, BigAnimal and SmallAnimal classes. Guess for yourself whose ancestor is whose. Then override the String getSize() method for Goose and Dragon so that they display strings about the animal's size.
8
งาน
Java Core, ระดับ, บทเรียน
OOP: Cars
Let's categorize cars. Create classes for affordable and expensive cars, and then make the Ferrari and GeoMetro classes inherit them as you see fit (but please note that the CodeGym code validator has a definite opinion on the matter). We'll implement printlnDesire methods in these classes that will tell us the secret desires of their drivers.
16
งาน
Java Core, ระดับ, บทเรียน
OOP: Books
In this task, we will create books written by the earthly authors Mark Twain and Agatha Christie. Using the MarkTwainBook and AgathaChristieBook classes, naturally, which inherit Book. You need to implement all the abstract methods in these classes. And in the parent class, implement the getOutputByBookType method.
8
งาน
Java Core, ระดับ, บทเรียน
OOP: Fix inheritance problems
Let's investigate some body parts. First, we'll check whether bones are present. You need to fix the containsBones method and all associated logic so that, without changing the program's behavior, it returns an Object: "Yes" instead of true, and "No" instead of false.