From the course: Java 8+ Essential Training: Objects and APIs
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
About encapsulation - Java Tutorial
From the course: Java 8+ Essential Training: Objects and APIs
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
About encapsulation3m 46s
-
Use the Java runtime classes4m 45s
-
(Locked)
Wrap code in static methods5m 56s
-
(Locked)
Declare and use custom classes4m 9s
-
(Locked)
Organize code with packages3m 46s
-
(Locked)
Create and use instance methods2m 27s
-
(Locked)
Manage state with instance variables7m 31s
-
(Locked)
Declare multiple constructor methods5m 2s
-
(Locked)
Use static fields as constants5m 51s
-
(Locked)
Declare and use enum types3m 44s
-
(Locked)
Organize code with nested types4m 15s
-
(Locked)
-
-
-
-
-