title: How to use functions/methods in SWITCH CASE statement in Java
body: <p>I have 3 types of array:
  <code>ControlType</code>
  <code>ControlName</code>
  <code>ControlValue</code></p>
  
  <p>When the control type is "ClickButton", I have to pass the corresponding ControlName and ControlValue.</p>
  
  <p>Code:</p>
  
  <pre><code>public class StringSwitchDemo extends StringSwitchDemoHelper
  {
      public static int getMonthNumber(String ControlType) {
          int ControlValue = 0;
          int ControlName  = 0;
  
          if (ControlType == null) {
              return ControlValue;
          }
  
          switch (ControlType.toString()) {
              case ClickButton:
                  return ControlType(ControlValue, ControlName);
                  break;
          }
  
          return ControlValue;
      }
  
      private static int ControlType(String controlValue, String controlName) {
          // TODO Auto-generated method stub
  
          return 0;
      }
  }
  </code></pre>