课程: Java Object-Oriented Programming
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Discovering inheritance in foundational Java classes - Java教程
课程: Java Object-Oriented Programming
Discovering inheritance in foundational Java classes
- [Instructor] With a good foundation of inheritance, we can begin to explore how the Java programming language uses inheritance. Exploring more examples will help you better understand this object-oriented concept and recognize the scenarios it should be used in. One common Java class is the Stack class. Stack is the data structure and while we won't be exploring data structures too much in this course, we'll explore how this class uses inheritance to inherit behaviors and attributes from its superclass. Here we have a stack of characters and we've added a few characters to the stack with the push method. Then we've removed the characters with the pop method. When the characters are removed, they'll be removed in reverse order, meaning t will be removed, then a, then c. Running the code, we'll see cat displayed in reverse order. That's what makes this a stack. We can plop things on top and remove them in order of…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
-
(已锁定)
What is inheritance?2 分钟 41 秒
-
(已锁定)
Leveraging different types of inheritance2 分钟 49 秒
-
(已锁定)
Using inheritance to reduce code duplication4 分钟 51 秒
-
(已锁定)
Discovering inheritance in foundational Java classes3 分钟 18 秒
-
(已锁定)
Challenge: Reduce redundant code with inheritance1 分钟 51 秒
-
(已锁定)
Solution: Reduce redundant code with inheritance4 分钟 37 秒
-
(已锁定)
-
-
-