Mapping Relationships in Java: Overriding Methods and Using Access Modifiers
Java
| Intermediate
- 15 videos | 2h 1s
- Includes Assessment
- Earns a Badge
Method overriding is a way in which a derived class can redefine - and override - the implementation of a method already defined in a base class. By overriding only those methods you absolutely need to and relying on the base class implementations for all others, you get a lot done with relatively little new code. Use this course to learn how to carry out this technique. Explore the somewhat surprising behavior of static methods and the phenomenon known as hiding. Use the final keyword to mark member variables, member functions, and even entire classes. Use the abstract keyword to indicate a given method is not implemented. Study the semantics of the access modifiers public, private, protected, and package-private. When you're done, you'll recognize how overriding differs from hiding, the semantics of access modifiers, and how abstract classes are used.
WHAT YOU WILL LEARN
-
Discover the key concepts covered in this courseOverride methods to have different method implementations in derived classesUse the super keyword in overridden methodsIdentify method hiding when redefining static methods with the same nameUse the final modifier to restrict a field from being initialized except in constructorsUse the final modifier with methods to prevent overriding and with classes to prevent inheritanceList the characteristics of an abstract classUse abstract base classes in inheritance hierarchies
-
Use the private access modifier to restrict access to fields and methodsContrast the restrictions offered by the public and private access modifiersUse factory methods to instantiate objects with private constructorsUse the protected access modifier to restrict access to derived classes and classes in the same packageInvestigate the nuances of the protected access modifierUse the default modifier to restrict access to other classes in the same packageSummarize the key concepts covered in this course
IN THIS COURSE
-
1m 49s
-
9m 44s
-
10m 45s
-
7m 3s
-
10m 5s
-
7m 18sIn this demo, you'll learn how to use the final modifier with methods and classes. You'll see how it applies to classes and methods. In the preceding demo, you've seen the use of the final modifier as applied to member variables. Now, you'll learn how it applies to classes and methods. FREE ACCESS
-
8m 46sIn this demo, you'll learn how to list the characteristics of an abstract class. An abstract class cannot be directly instantiated and must be extended before being instantiated. You'll also learn that abstract classes often have abstract methods which are not implemented, they're just defined. This makes it clear what the interface of an object is. FREE ACCESS
-
11m 35s
-
8m 39s
-
5m 10s
-
7m 46s
-
9m 5s
-
10m 6s
-
9m 13s
-
2m 59s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.