012-002-005

Static Method: Greeting Utility

Easy

Problem Description

static method: Greeting Utility

Learning Objective: Process text with static method

In this problem, you will create a program that reads a name from standard input, generates a greeting message using a static method, and displays two lines to standard output.

Create a utility class that generates greeting messages. Implement the static method greet(String name) to output "Hello, [name]!" followed by "Welcome!" from the received name.

Input

Line 1: Name (string)

Output

Hello, [name]!
Welcome!

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