title: Call method Dynamically based on param in Scala
body: <p>i have on class bellow in scala</p>
  
  <pre><code> class A(arg:String){
  
   // this method is going to call many time 
   def exce():String ={
   // i do not want to use if else here
   if("arg"=="a1")
   a1("abc")
   if("arg"=="a1")
    a2("abc")
   }
   def a1(arg1:String):String={
   "in a1"
   }
   def a2(arg1:String):String={
   "in a2"
   }
   }
  </code></pre>
  
  <p>I will create instance of class A and will pass arg value as method name now 
      how can i call method "exce",and exce method will call a1 or a2 based on args
      like 
      new A("a1").exce()  -- output will be a1
      how can achieve this without using if else in "exce" method </p>
  
  <p>can some one help here </p>