Java Annotations

  • Annotations let you attach metadata to your code
  • Has no effect on its own
  • Discoverable through a Java API called reflection
@DisplayName("The XYZ Gizmo")
class XyzGizmoTest {

    @BeforeEach
    public void setup() { /* ... */ }
    
    @Test
    public void itWorksRight() { /* ... */ }
}

3 / 21