title: Methods and Constructors
body: <p>How do you use a method with code inside in? </p>
  
  <pre><code>public void initialiseVariables(){
               name=timestamp.substring(0, 20);
  
              // numofdep = timestamp.substring(35, 37);
               //noofovertime = timestamp.substring(38, 40);
       if(timestamp.charAt(20)=='C')
           city=true;
       if(timestamp.charAt(21)=='U')
           union=true;
  identificationnumber=Integer.parseInt(timestamp.substring(22,26));//to get an integer from a string use the integer.parseint
               numofdep = Integer.parseInt(timestamp.substring(35, 37));
               noofovertime = Integer.parseInt(timestamp.substring(38, 40));
       hoursworked=Integer.parseInt(timestamp.substring(27,29));
                hourlyrate = Double.parseDouble( timestamp.substring(30, 34));
   }
  </code></pre>
  
  <p>I don't understand what you put inside the constructor. Also how do you determine what you put inside the parameters? like this constructor my friend wrote.</p>
  
  <pre><code> Employees(){
  
       this.timestamp=timestamp;
       initialiseVariables();
   }
  </code></pre>
  
  <p>So how do I use for example the line,</p>
  
  <pre><code> name=timestamp.substring(0, 20);
  </code></pre>
  
  <p>in my main class? </p>