fork download
  1. // package io.hexlet.model;
  2.  
  3. class User {
  4. public static String getGreeting(String userName) {
  5. return "Hello, " + userName + "!";
  6. }
  7. }
  8.  
  9. public class Main {
  10. public static void main(String[] args) {
  11. String userName = "Alice";
  12. String greeting = User.getGreeting(userName);
  13. System.out.println(greeting);
  14. }
  15. }
Success #stdin #stdout 0.14s 57632KB
stdin
Standard input is empty
stdout
Hello, Alice!