课程: Java Object-Oriented Programming
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Challenge: Leverage abstraction to write simpler applications - Java教程
课程: Java Object-Oriented Programming
Challenge: Leverage abstraction to write simpler applications
(bright music) - [Instructor] In this challenge, you'll practice using abstraction to reduce application complexity and code duplication. Earlier in the chapter, we created an event interface with two method specifications. We had three different classes extend this interface, password change event, missed payment event, and account transfer event. All three of these classes have duplicated code for the get timestamp method. They also have the same attributes, create a timestamp and ID. Can you refractor this code so that the get timestamp functionality and the attributes live in one place? Note, all of the duplicated code has to do with what it means to be an event rather than a specific missed payment or password change event. Given this refactoring, the code in the main class should not change significantly. We should still be able to work with the events as event objects. In this challenge, I encourage…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
-
-
(已锁定)
What is abstraction?1 分钟 47 秒
-
(已锁定)
Using abstract classes in Java to reduce code complexity5 分钟 59 秒
-
(已锁定)
Using interfaces in Java to provide conformity5 分钟 1 秒
-
(已锁定)
Discovering abstraction in Java source code4 分钟 55 秒
-
(已锁定)
Challenge: Leverage abstraction to write simpler applications1 分钟 19 秒
-
(已锁定)
Solution: Leverage abstraction to write simpler applications2 分钟 58 秒
-
(已锁定)
-