Challenges

Create a Greeter Class

Create a class named Greeter that stores a greeting message.

Your class should have:

  1. A public String property called message
  2. A method called greet that takes no parameters and returns the message

Example usage:

Greeter g = new Greeter();
g.message = 'Hello, World!';
String result = g.greet(); // Returns 'Hello, World!'

This challenge introduces you to the basics of creating a class with a property and a method.

Editor
Test Results

Result Panel

Hit the run button to test your code!