Homework 03 - Object-oriented programming: Encapsulation/Inheritance/Polymorphism

Опубликовано: 25 Апрель 2024
на канале: Stefan Macke
490
18

Your homework:

Remove the initialization of attributes with default values ​​in the Coffee Machine class.

Add two constructors to the Coffee Machine class.

One should only receive the name, and the other should receive the name, coffee type, and fill level.

Set the coffee type and fill level to sensible default values ​​in the first constructor.

Restructure the creation of the coffee machines in the Canteen class so that the second constructor is used.

Pay attention to checking the values ​​during the constructor call, potential null pointers, and the correct output of the program.

----

00:00 Introduction
00:31 Current Status
01:06 Removing Initialization
01:18 Adding Constructors
02:08 Delegating Constructor Calls
02:43 Calling Constructors
03:34 Validation Testing
04:06 Preventing NullPointerExceptions
04:35 Final Result


На этой странице сайта вы можете посмотреть видео онлайн Homework 03 - Object-oriented programming: Encapsulation/Inheritance/Polymorphism длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Stefan Macke 25 Апрель 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 490 раз и оно понравилось 18 зрителям. Приятного просмотра!