I just yesterday started learning some Java. I wrote this piece and got some help from @Simon Andr Forsberg to refine it some. I added a few things since. It's super-simple but I just want to make sure I have a few concepts down before I move on to more complex things. Any constructive criticism is appreciated!import java.lang.*;public class HelloWorld {    private final String output;    public HelloWorld(String name) {        output = Hello World,  + name + !;    }    public String getMessage() {        return output;    }    public static void main (String args[]) {        HelloWorld helloObj;        helloObj = new HelloWorld(Phrancis);        System.out.println(helloObj.getMessage());    }}Console output:Hello World, Phrancis!
Hello World, Phrancis
java;beginner
In Java it is seldom necessary to create void variable 'declarations'. The code:HelloWorld helloObj;helloObj = new HelloWorld(Phrancis);should just be:HelloWorld helloObj = new HelloWorld(Phrancis);Then, for the actual HelloWorld class, there are a few hints:All Java objects have a toString() method that should, in most cases, be overridden to provide useful diagnostics, or other information. In this case, it would make sense to use the toString() instead of getMessage()You should store data in it's 'raw' form when possible. Your HelloWorld class should store the 'name' and not the 'output'.You should provide getters for internal properties.I would write the class as:public class HelloWorld {    private final String name;    public HelloWorld(String name) {        this.name = name;    }    public String getName() {        return name;    }    @Override    public String toString() {        return Hello World,  + name + !;    }}Then your main method could be:public static void main (String args[]) {    HelloWorld helloObj = new HelloWorld(Phrancis);    System.out.println(helloObj);}