Java Annotations

Treehouse
Course Summary
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.
-
+
Course Description
About this Course 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.
About the Teacher
On the side I run a nonprofit organization that takes teenagers to developing countries to volunteer during the summer. I enjoy running and yoga, especially outdoors in the beautiful Chicago summer weather.
-
+
Course 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. 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. 13 steps