Java Annotations Course

Go to class
Write Review

Free Online Course: Java Annotations Course provided by Treehouse is a comprehensive online course, which lasts for 1-2 hours worth of material. The course is taught in English and is free of charge.

Overview
  • Annotations have rapidly become the preferred approach to integrating powerful third-party libraries into your own Java applications. In this course, we'll first explore the basic use of annotations to give the compiler instructions. Then, we'll use more advanced techniques to create our own annotation and look for it using reflection.

Syllabus
  • Using Java's Built-In Annotations

    Java includes some built-in annotations to give the compiler instructions. In this stage, we'll explore the use of these three annotations: @Override, @Deprecated, and @SuppressWarnings.

    Chevron 17 steps
    • Introduction to Annotations

      2:16

    • Getting Started with Annotations

      1 question

    • The @Override Annotation

      4:49

    • The @Override Annotation

      1 question

    • Adding the @Override Annotation

      1 objective

    • Using @Override to Fix an Error

      1 objective

    • The @Deprecated Annotation

      3:31

    • The @Deprecated Annotation

      1 question

    • Using the @Deprecated Annotation

      1 objective

    • Intro to Command Line Options for the Java Compiler

      3:48

    • Command Line Options for the Java Compiler

      2 questions

    • Using the Directory and Xlint Command Line Options

      5:11

    • Using the Directory and Xlint Options in the Command Line

      2 questions

    • The @SuppressWarnings Annotation - "static"

      4:40

    • The @SuppressWarnings Annotation - "static"

      1 objective

    • The @SuppressWarnings Annotation - "fallthrough"

      5:30

    • The @SuppressWarnings Annotation - Suppressing Multiple Warnings

      1 objective

    Writing Your Own Annotation

    Understanding exactly how an annotation is coded and used is critical to fully leveraging the power of popular third-party libraries. During this stage, we'll create our own annotation, apply it to a class and some methods, and test for its presence using a programming technique called reflection.

    Chevron 13 steps
    • Project Overview: Docgen

      3:48

    • Starting the Annotation - Declaration and Retention

      4:15

    • Declaring an Annotation

      1 question

    • Declaring an Annotation

      2 objectives

    • Finishing the Annotation - Targets and Elements

      4:01

    • Adding Annotation Targets and Elements

      2 objectives

    • Using a Custom Annotation

      3:20

    • Applying an Annotation

      3 questions

    • Introduction to Reflection

      11:40

    • Reflection Basics

      2 questions

    • Reflection Basics

      2 objectives

    • Using Reflection on Our Annotation

      9:06

    • Putting It All Together

      4 objectives