MODULE 4 JAVA CLASSES AND METHODS CHAPTER 3 Abstraction and Encapsulation
Abstraction 4. Java Classes and Methods Data abstraction is the process of hiding certain details and showing only essential information to the user Can be achieved with either abstract classes or interfaces Use abstract keyword to define an abstract class
Abstract Class 4. Java Classes and Methods Abstract class cannot be used to instantiate an object Must be inherited from another class Abstract class may or may not include abstract methods
Abstract Method 4. Java Classes and Methods Only used inside a given abstract class It does not contain any body When a subclass inherited this abstract class it will ask to override the given method
Encapsulation 4. Java Classes and Methods Make data hidden (by declaring the properties as private) When data is said to be private you can access those data through standard methods called the setter (write) and getter (read) Better Control Secured Data Flexible
Coding Simulation 4. Java Classes and Methods
Sources https://www.tutorialspoint.com/java/index.htm https://www.javatpoint.com/java-tutorial https://dev.java/learn/getting-started/ https://www.w3schools.com/java/default.asp Next Chapter: Polymorphism and Inheritance 4. Java Classes and Methods