how to convert a string to an integer in java : <p>i get an error when try to convert a string to an integer</p>

<pre><code>  public static void main(String[] args){
  String rate= "3.7";
  int age=20;
  boolean istrue=true;
  double salary=60.4;

  //convert to String
  String Newsalary=String.valueOf(salary);
  String Newage=String.valueOf(age);
  String Newistrue=String.valueOf(istrue);
  //convert to Integer
 int Newrate= Integer.parseInt(rate);//here is the probleme
  int NewsalaryInt=(int) salary; 
  //convert to double
  double NewrateDouble=Double.parseDouble(rate);
  double NewageDouble=(double) age;


  }
  }
</code></pre>

<p>the problem is when i convert rate varaible which is String to an integer</p>
