title: A Program Construction in Java
body: <p>I'm having an issue with my programs construction. I can't seem to find where or why I need to put my constructor in. I can't tell if it is in there, or not. Anyway, here is the main code:</p>
  
  <pre><code>import java.io.FileNotFoundException;
  import java.util.Scanner;
  
  public class HangmanProject
  {
      public static void main(String[] args) throws FileNotFoundException
      {
          public static void getFile() {
  
      getFile gf() = new getFile();
      Scanner test = gf.wordScan;      
     }     
  }
  </code></pre>
  
  <p>So that's the main program but it calls this one:</p>
  
  <pre><code>import java.io.BufferedReader;
  import java.io.FileReader;
  import java.util.Scanner;
  
  public class getFile 
            {  
      String wordList[] = new String[10];    // array to store all of the words
      int x = 0;
  
      Scanner keyboard = new Scanner(System.in);    // to read user's input
  
      System.out.println("Welcome to Hangman Project!");
  
                                   // Create a scanner to read the secret words file
      Scanner wordScan = null;
  
      try {
          wordScan = new Scanner(new BufferedReader(new FileReader("words.txt")));
          while (wordScan.hasNext()) {
              wordList[x] = wordScan.next();  
              System.out.println(wordList[x]);  
              x++;  
                                     }
          } 
      finally {
          if (wordScan != null)
          {
              wordScan.close();
          }
      }
  }
  </code></pre>
  
  <p>My questions are:</p>
  
  <ul>
  <li>where is my constructor, </li>
  <li>am I using it correctly, </li>
  <li>should my layout be changed? </li>
  </ul>
  
  <p>My instructor is telling me that <em>"I still do not see the constructor method in your class where you should be initializing the instance variables for your class. You cannot just put code inside a class."</em> I really don't understand what that means. </p>