title: Make global instance of class - JAVA
body: <p>In this code, I am trying to make global instance of class so any methods can use it:</p>
  
  <pre><code>public static void clip(){
      while(!Display.isCloseRequested()){
          glClear(GL_COLOR_BUFFER_BIT);
  
          if(character.gravity)character.y++; //there is an error, it says "Variable character does not exist"            
          Display.update();
          Display.sync(70);
      }
  }
  
  public static void initGame(){
      entity character = new entity(); // I want to use this in method clip()
      character.create(true, "box", true);
  }
  </code></pre>
  
  <p>I've searched google, but on my question "Make instances of class global" found nothing.
  Thanks for help.</p>