MyClass.java
 

public class MyClass {
  public static void main(String[] args) {
    String name = "John";
    System.out.println("Hello " + name);
  }
}

Result:
Hello John