课程: Java Object-Oriented Programming
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
What is encapsulation?
- [Instructor] Encapsulation is one of the forming principles in object-oriented programming. It refers to the idea of binding an object state and behavior together into one unit. In other words, encapsulation is about wrapping data and code acting on that data together. This may sound familiar and it should. In the last chapter, we bound together data and methods in the form of a Java class. Now we're giving this idea a formal name, encapsulation. While we saw the beginnings of how to perform encapsulation by pure organization of the code, in this chapter, we'll expand upon that concept, as well as look at some of the benefits of this approach. One benefit is we can prevent classes from being tightly coupled. This means we can easily modify one class, either in the data it contains or its behaviors, without affecting the rest of the program. However, this can only happen if we have a clear interface between the class and the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
(已锁定)
What is encapsulation?2 分钟 16 秒
-
(已锁定)
Discovering access modifiers2 分钟 35 秒
-
(已锁定)
Implementing encapsulation with access modifiers4 分钟 20 秒
-
(已锁定)
Exploring encapsulation in Java string class3 分钟 37 秒
-
(已锁定)
Challenge: Banking application1 分钟 14 秒
-
(已锁定)
Solution: Banking application4 分钟 29 秒
-
(已锁定)
-
-
-
-