title: Proper Constructors to Run all Methods in Java
body: <p>I have this class and need to know which constructor is needed to create an object that may immediately use all its methods without error</p>
  
  <pre><code>public class Robot {
      private boolean fuelEmpty = true;
      private int roboID;
      private String greeting;
      private String securityProtocol;
  
  //insert robot constructor here
  
  public void destroyAllHumans(){
      while (fuelEmpty == false) {
          //robot begins to destroy all humans
      }
  }
  public int getRoboID(){
      return roboID;
  }
  public void greet(){
      System.out.println(greeting);
  }
  public void setSecurityProtocol(String proto){
      securityProtocol = proto;
  }
  }
  </code></pre>
  
  <p>For example should look like this:</p>
  
  <pre><code>public Robot(int id, String greet) {
      roboID = id;
      greeting = greet;
  }
  </code></pre>
  
  <p>or this:</p>
  
  <pre><code>public Robot(int id, String greet) {
      roboID = id;
      greeting = greet;
      fuelEmpty = false;
  }
  </code></pre>
  
  <p>or:</p>
  
  <pre><code>public Robot(boolean full, int id, String greet, String proto) {
      roboID = id;
      greeting = greet;
      fuelEmpty = full;
      securityProtocol = proto;
  }
  </code></pre>
  
  <p>Which of these (or something else different) is needed so that all the other methods can run without an error?</p>