007-004-007
Method Definition: Greeting Method
Easy
Problem Description
method Definition: Greeting method
In this problem, you will create a program that defines a sayHello method in a Greeter class, instantiates the class, and calls the method to display "Hello, World!" to standard output.
Learning Objective: Understand how to define and call methods within a class
Overview
Create a Greeter class and define a sayHello method that displays a greeting. The method call should output "Hello, World!".
Specifications
- Define sayHello method in Greeter class
- Method has no parameters, no return value (void)
- Output "Hello, World!" inside method
- Create Greeter instance in main method and call sayHello
Output Format
Hello, World!
Ready to Try Running Code?
Log in to access the code editor and execute your solutions for this problem.
Don't have an account?
Sign Up