Solution:
Gavin, we can do it by creating a simple string type method. I hope you already know about java methods well. If not, you should learn, and practice it ASAP. Java is an OOP language, so learning the usages methods and objects is a must in java. It makes our program efficient and multi-functional alongside.
Let’s write a program that works as like as you want:
public class HelloBob {
public static void main(String[] args) {
HelloBob test = new HelloBob();
System.out.println(test.helloString("Bob"));
}
public String helloString(String input) {
return "Hello " + input + "!";
}
}
Keep exploring and solving problems.
Thanks