title: How can we check that how many times a java program has executed previously?
body: <pre><code>class Testing{
  
      static int count = 0;
      public Testing(){
          count++;
      }
      public static void main(String[] args){
          Testing[] testObjects= new Testing[20];
          for(int i = 1; i&lt;20;i++){
              if(Testing.count==5){
                  System.out.println("5 objects are created.. Can't create anymore, although 20 objects can be stored");
                  System.exit(0);
              }
              else{
                      testObjects[i] = new Testing();
                      System.out.println("Object "+Testing.count+" is created.");
              }
          } // for loop close
          System.out.println("Program will exit");
      }
  }
  </code></pre>
  
  <p>I have tried this code but it only keeps the information of a single run and I need to track the multiple execution </p>