Advanced Features in Java: Using Built-in Annotations

Java SE 13
  • 11 Videos | 1h 28m 6s
  • Includes Assessment
  • Earns a Badge
Likes 9 Likes 9
In this course, you'll learn how annotations are defined and used in Java. You'll explore three popular built-in annotations, the @Override, @Deprecated, and @SuppressWarnings built-in annotations. Next, you'll examine how the @Override annotation is a valuable aid in detecting and fixing typos in the names of overridden methods, and crucially, helps to detect such issues at compile-time rather than at run-time. Then you'll explore the @Deprecated annotation and see how if you mark a class, method, or variable with the @Deprecated annotation, Java will issue an appropriate warning when you reference that element. You'll also learn about the @SuppressWarnings annotation, which does exactly what its name suggests, and for that reason ought to be used only with extreme caution, if at all. The @SuppressWarnings annotation allows the selective suppression of different types of warnings. You can also entirely eliminate all compiler warnings using @SuppressWarnings annotation with the "all" input argument, but this is quite dangerous and is an especially egregious programming practice.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    define a method, override it, and then mark that overridden version with the @Override annotation
    apply the @Override annotation to detect typographical errors in method names at compile-time rather than at run-time
    recognize different common overrides of methods in java.lang.Object such as the .toString, .equals, and .hashCode methods
    identify correctly and incorrectly overridden implementations of the .equals method
    recognize how the @Deprecated annotation can be used to flag the instantiation of objects of deprecated classes at compile-time
  • analyze how the @Deprecated annotation works on elements other than classes
    recognize how the forRemoval named element from the @Deprecated annotation works
    enumerate different scenarios in which the @SuppressWarnings annotation can be applied
    recognize the different warnings that can be eliminated using the @SuppressWarnings annotation, and why this annotation ought to be used sparingly, if at all
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 44s
    UP NEXT
  • Playable
    2. 
    Introduction to the @Override Annotation
    8m 51s
  • Locked
    3. 
    Using @Override to Protect Against Typos
    8m 37s
  • Locked
    4. 
    Overriding the .toString, .equals, and .hashCode Methods
    9m
  • Locked
    5. 
    Correctly Overriding the .equals Method
    6m 39s
  • Locked
    6. 
    Introduction to the @Deprecated Annotation
    10m 46s
  • Locked
    7. 
    More Uses of the @Deprecated Annotation
    10m 58s
  • Locked
    8. 
    The forRemoval Element from the @Deprecated Annotation
    7m 34s
  • Locked
    9. 
    The @SuppressWarnings Annotation
    7m 23s
  • Locked
    10. 
    Usage Scenarios of the @SuppressWarnings Annotation
    8m 55s
  • Locked
    11. 
    Course Summary
    2m 9s

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.