Modeling Entities in Java: Static Members, Arguments, & Method Overriding
Java SE 15
| Expert
- 14 Videos | 2h 6s
- Includes Assessment
- Earns a Badge
The best way to avoid mysterious bugs while running your Java code is to be adept at working with static members, argument passing, and object base class methods. Use this course to master these subtleties: the difference between static and instance variables and methods, the hashCode contract, and how pass-by-value and pass-by-reference semantics play out with argument passing in Java. By the end of this course, you'll be able to model state in classes using both static and instance variables, write methods to avoid unexpected changes in input arguments, and adhere to the hashCode contract so that objects function as expected when placed in common Java containers.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courserecall Java best practices to access static variablesuse class references to access static variables and describe the use of the 'final' keywordoutline access restrictions on instance members from static membersimplement a scenario using a static variable to count instantiated objectsuse class reference to invoke and execute static methodsreassign variables inside methods and explore where the changes are visible
-
contrast the effects of variable reassignment with variable modificationoutline pass-by-value and pass-by-reference with custom objectsrecall the operation of the == operator and the default .equals() methodexamine how to work with the .equals() and .hashCode() methods and the hashCode contractoverride .equals() to check for semantic equalityoverride .hashCode() and .equals() to honor the hashCode contractsummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview2m 35sUP NEXT
-
2.Accessing Static Variables10m 31s
-
3.Using Static Variables and the final Keyword8m 4s
-
4.Working with Static and Instance Methods and Fields9m 51s
-
5.Using a Static Field for Auto-counting Objects9m 47s
-
6.Using a Class Reference to Invoke Static Methods11m 43s
-
7.Exploring Field Reassignments9m 49s
-
8.Understanding Pass-by-Value and Pass-by-Reference10m 52s
-
9.Pass-by-value/Pass-by-reference with Custom Objects4m 54s
-
10.Checking Object Equality with == and .equals()10m 23s
-
11.Understanding the HashCode Contract8m 31s
-
12.Overriding the .equals() Method8m 45s
-
13.Overriding the .hashCode() Method11m 33s
-
14.Course Summary2m 50s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.