1. Learn
  2. /
  3. Courses
  4. /
  5. Input/Output and Streams in Java

Connected

Exercise

Navigating with Enum

Enums are great for representing real-world directions clearly in code. Imagine you're creating a navigation feature for an application that provides instructions to users.

Instructions

100 XP
  • Define an enum named Direction containing constants: NORTH, EAST, SOUTH, and WEST.
  • Create a method with a Direction parameter.
  • Print the EAST direction using printDirection().