title: Object Oriented Programming - Avoid Switch/Case and If/else (JAVA)
body: <p>I got a problem where I am not allowed to use switch/case or if/else queries.</p>
  
  <p>I got a config file I read which is this:</p>
  
  <pre><code>650;0;1.5;month
  614;0;2.88;year
  466;0;2.48;week
  716;0;4.6;half-year
  718;0;2.6;quarter
  </code></pre>
  
  <p>I am splitting those Strings at the ";", so it is saved in an array. The problem I have, that I need to do other things in the code for each time given in that array ar[3], so if it is a month I need other calculations then when it is a full year.</p>
  
  <p>But I am not allowed to do this with Switch/case or If/Else, now I am getting confused.</p>
  
  <pre><code>If (ar[3] = month){
  do this;
  else if (ar[3] = year) {
  do this; 
  }
  </code></pre>
  
  <p>How am I doing this object oriented? Thanks for every help :)</p>