title: A program that contains employee data if employee tenure is more than three years call all functions in main (In java)
body: <p>I am writing a program in java that contains variables to hold employee data like</p>
  
  <ul>
  <li><code>EmployeeCode</code></li>
  <li><code>EmployeeName</code></li>
  <li><code>EmployeeDateOfJoining</code><br></li>
  </ul>
  
  <p>I have written a function that assigns user defined values to these variables that I mentioned above. In variable <code>EmployeeDateOfJoining</code> i store values like <code>3-3-2019</code>. After this, I want to write another function that asks the user to enter the current date and then checks if the employee tenure is more than three years or not.<br> If an employee's tenure is more than 3 years than call the functions otherwise not.
  <br></p>
  
  <pre><code>package assignment;
  import java.util.Scanner;
  import java.util.Calendar;
  public class EmployeeData {
  
      String EmployeeName, EmployeeCode, DateOfJoining;
      Scanner input=new Scanner(System.in);
      Calendar c1=Calendar.getInstance();
      public void Employee_Data()
      {
      System.out.println("Enter the employee name:");
      EmployeeName=input.nextLine();
  
      System.out.println("Enter Employee code:");
      EmployeeCode=input.nextLine();
  
      System.out.println("Current date:"+(c1.get(Calendar.MONTH)+1)+"-" 
      +c1.get(Calendar.DATE)+ "-" +c1.get(Calendar.YEAR));
      }
      public void checkdate()
      {
      System.out.print("Enter his date of joining --&gt; - should be used and all entries must be integer:");
      DateOfJoining=input.nextLine();
  
      }
  }
  </code></pre>
  
  <p><strong>This is main Class</strong> <br></p>
  
  <pre><code>package assignment;
  
  public class Assignment {
      public static void main(String[] args) {
          EmployeeData E1=new EmployeeData();
          E1.Employee_Data();
          E1.checkdate();
      }
      }
  </code></pre>
  
  <p>If i enter date like <code>21-3-2019</code> then it should subtract this from current date and should show me output in this format e.g <code>22-3-2018</code> </p>