Constructor

A class is a template defined at compile-time to be used at runtime for instantiating objects. Like a cookie-cutter is a template for stamping out a series of cookies.
Each time your app makes another object, another HangMen game in this case, you may need some set-up work to be done to get that object ready for work. This work is usually done in a constructor method. The constructor is a special method that is named exactly the same as the class name. The constructor is also special in that it has no return value specified; all other methods must specify a return type or specify void while a constructor does neither. The Java platform guarantees that the constructor runs until completely done before the object will be put into service.
You can think of the constructor as that moment while cutting out a cookie where you get to decorate the cookie. Only after decoration is complete do you set the cookie on a platter to be eaten, like readying an object to be put to work.
Tip: I find it helpful to label my constructor methods with a comment line. Make it easier to scan when reading code.
This process of creating, preparing, putting-to-work, and eventually stopping a chunk of software at runtime is known as lifecycle, and is one of the key concepts to learn about in programming.
To keep your list of strings around for use after the initial construction, define the variable as a member field on the class.
And, by the way, in modern Java you need not repeat the < String > on the ArrayList, as the compiler can figure that out.
Be sure to learn and follow Java naming conventions. A class name should start with an initial uppercase letter. So HangMen, not hangMen. In contrast, the variables holding a reference to an object (an instance) start with a lowercase letter.
public class HangMen{
// ----| Members |------------------------
private List< String > stage ;
// ----| Constructor |------------------------
public HangMen() {
this.stage = new ArrayList<>() ;
stage.add("-------");
stage.add("| |");
stage.add("|");
stage.add("|");
stage.add("|");
stage.add("|");
stage.add("|___________");}
}
public void report() {
System.out.println( "stage: " ) ;
System.out.println( this.stage.toString() ) ;
}
}
Let's try out this class in a main method.
HangMen hangMen = new HangMen() ; // Invokes your constructor implicitly. At runtime, the class `HangMen` (note the uppercase `H`) is used to create a new instance (new object). A reference to the object is assigned to the variable named `hangMen` (note the lowercase `h`).
hangMen.report() ; // Invokes the `report` method for this instance (this object).
Notice the option use of this.stage versus stage. The this. makes clear you mean a member variable, not a local variable. The compiler can usually detect on its own when you are referring to a member variable versus a local variable. In prior years I preferred using the this. to make reading the code quite clear. But now IDEs with their colorization features provide a visual clue as to which variables are members versus local. So you may want to omit the this. prefix. I showed both here as an example.
Tip: For clarity, do not put a main method in your HangMen class. Put it in another class, named something like App, in its own .java file. A main method is basically a necessary evil, just a non-object-oriented hack to get our object-oriented heaven launched from the cold cruel world of hardware, operating-systems, and command-line consoles. Separating, and basically ignoring, the main method can help in learning Java.
public class App {
public static void main( String[] args ) {
HangMen hangMen = new HangMen() ; // Invokes your constructor implicitly. At runtime, the class `HangMen` (note the uppercase `H`) is used to create a new instance (new object). A reference to the object is assigned to the variable named `hangMen` (note the lowercase `h`).
hangMen.report() ; // Invokes the `report` method for this instance (this object).
}
}