课程: Java Object-Oriented Programming
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
Exploring encapsulation in Java string class - Java教程
课程: Java Object-Oriented Programming
Exploring encapsulation in Java string class
- With the good foundation of encapsulation, we can begin to explore how the Java programming language, uses encapsulation in some of its built-in classes. Exploring more examples will help you better understand this object oriented principle, and recognize the scenarios it should be used in. One common Java class that uses encapsulation, is the string class. To find out more about the string class, we'll click into it using our IDE. I'm on a Mac, so I'll do Command Click, but it may be different on your machine. This class is pretty large at over 3000 lines, but we'll break it into parts and work through it, to see how it uses encapsulation. A string is made up of characters, and those character values actually live in the form of bytes and a byte array. This is all hidden away from us and the way we use strings in everyday programs. This means, even if things inside the string class change, it won't affect the rest…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-
-
-