title: How to get the variable name with highest number in java?
body: <p>I need the highest value among North, south, east and west and in result, i just have to return the name north, south, east or west. Highest value have to be obtained by comparing all the values of north, south, east and west.</p>
  
  <p>Below is my code snippet.</p>
  
  <pre><code>public String startpgm(String x){
      String result=null;
      double priority = 0;
      double North    = 1;
      double South    = 3;    
      double East     = 4;
      double West     = 5;
  
      System.out.println("Priority:"+Math.max(North, South)); //I am getting the max value, what i need is North or South!!
      priority= Math.max(North, South);
      result = Double.toString(priority);
      return result ;
  }
  </code></pre>