Mapping Relationships in Java: Overriding Methods and Using Access Modifiers

Java    |    Intermediate
  • 15 videos | 2h 1s
  • Includes Assessment
  • Earns a Badge
Rating 4.5 of 55 users Rating 4.5 of 55 users (55)
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 course
    Override methods to have different method implementations in derived classes
    Use the super keyword in overridden methods
    Identify method hiding when redefining static methods with the same name
    Use the final modifier to restrict a field from being initialized except in constructors
    Use the final modifier with methods to prevent overriding and with classes to prevent inheritance
    List the characteristics of an abstract class
    Use abstract base classes in inheritance hierarchies
  • Use the private access modifier to restrict access to fields and methods
    Contrast the restrictions offered by the public and private access modifiers
    Use factory methods to instantiate objects with private constructors
    Use the protected access modifier to restrict access to derived classes and classes in the same package
    Investigate the nuances of the protected access modifier
    Use the default modifier to restrict access to other classes in the same package
    Summarize the key concepts covered in this course

IN THIS COURSE

  • 1m 49s
  • 9m 44s
  • Locked
    3.  Invoking Base Class Methods Using super()
    10m 45s
  • Locked
    4.  Identifying Method Hiding
    7m 3s
  • Locked
    5.  Using the Final Modifier with Fields
    10m 5s
  • Locked
    6.  Using the Final Modifier with Methods and Classes
    7m 18s
    In 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
  • Locked
    7.  Characterizing Abstract Classes
    8m 46s
    In 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
  • Locked
    8.  Using Abstract Classes in Inheritance Hierarchies
    11m 35s
  • Locked
    9.  Using the Private Access Modifier
    8m 39s
  • Locked
    10.  Using the Public and Private Modifiers
    5m 10s
  • Locked
    11.  Using Factory Methods to Instantiate Objects
    7m 46s
  • Locked
    12.  Using the Protected Access Modifier
    9m 5s
  • Locked
    13.  Investigating Protected Access Modifier Nuances
    10m 6s
  • Locked
    14.  Using the Default Access Modifier
    9m 13s
  • Locked
    15.  Course Summary
    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.

YOU MIGHT ALSO LIKE

Rating 4.6 of 62 users Rating 4.6 of 62 users (62)
Rating 4.5 of 75 users Rating 4.5 of 75 users (75)
Rating 4.4 of 56 users Rating 4.4 of 56 users (56)

PEOPLE WHO VIEWED THIS ALSO VIEWED THESE

Rating 4.4 of 34 users Rating 4.4 of 34 users (34)
Rating 4.4 of 38 users Rating 4.4 of 38 users (38)
Rating 4.6 of 144 users Rating 4.6 of 144 users (144)