课程: Java 8+ Essential Training: Objects and APIs
今天就学习课程吧!
今天就开通帐号,24,600 门业界名师课程任您挑!
About encapsulation
- [Instructor] Java is an object-oriented language and one of the most important principles in object-oriented programming, is called encapsulation. It means that you're packaging complex functionality to make it easier to use. When you first create Java applications, most new programmers will put all of their code into a main method. But as your applications get larger and more complex, putting all of the code in one place, makes it very different to manage. So instead, you want to break the code out into individual classes, grouping the functionality as the logic dictates for your application and each of those classes, can do it's part of the job. Here's an analogy. Let's take a look at a non-encapsulated industrial machine. This is an olive press. In order to use this machine, if you were asked to know everything about how it worked, it might be different to get started. If you had to know which direction each gear was going to turn, which order each of the pressing arms was going…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
-
(已锁定)
About encapsulation3 分钟 46 秒
-
Use the Java runtime classes4 分钟 45 秒
-
(已锁定)
Wrap code in static methods5 分钟 56 秒
-
(已锁定)
Declare and use custom classes4 分钟 9 秒
-
(已锁定)
Organize code with packages3 分钟 46 秒
-
(已锁定)
Create and use instance methods2 分钟 27 秒
-
(已锁定)
Manage state with instance variables7 分钟 31 秒
-
(已锁定)
Declare multiple constructor methods5 分钟 2 秒
-
(已锁定)
Use static fields as constants5 分钟 51 秒
-
(已锁定)
Declare and use enum types3 分钟 44 秒
-
(已锁定)
Organize code with nested types4 分钟 15 秒
-
(已锁定)
-
-
-
-
-