title: How to compare object parameter to another object parameter (inside array)
body: <p>What do I need to write inside the " if " statement in order to check if the object's variable (number) is equal to any of the object's variables (number) inside my array?</p>
  
  <pre><code>public class Question{
  
      private int number;
      private String questionString;
      private int index = 0;
  
      public Question(int number, String questionString){
  
  
  if(number &lt; 0){
          System.out.print("Number cannot be negative!");
      }
      if(questionString.equals(null) || questionString.trim().isEmpty()){
          System.out.print("Question cannot be empty!");
      }
  
          this.number = number;
          this.questionString = questionString;
      }
  
      public boolean equals(Object o){
              if(o instanceof Question){  
                 for(int i = 0; i &lt; index; i++){
                     if(.... ){
  
                     }
                 }
                  return true;
              }
              return false;   
          }
  
  
  }
  </code></pre>
  
  <p>Test Class (main Class), ofc not yet completed I just hope it gives you enough information, on how to proceed on my Question class:</p>
  
  <pre><code>public class Test{
          String name;
          Question[] questions;
  
          public Testi(String name, int nrQuestions){
  
          }
  
          public static void main(String[]args){
  
          }
  
  }
  </code></pre>