i got this error in androidStudio : java.lang.NumberFormatException: For input string: " " : for example i want to create contacts that only has two fields name and age, but only name is important for me.

    public class Contact {

    public String name;
    public int age;

    public Contact(String name) {
        this.name = name;
    }

    public Contact() {
      
    }
     public Contact(String name,int age) {
        this.name = name;
        this.age=age
    }
}

  
in the part of code for some reason i need user add new Contact and its not important to insert age.
after user submit i expect get new Contact.


    EditText editName=findviewByid(r.id.edit_name);
    EditText editAge=findviewByid(r.id.edit_age);
    .
    .
    .

 when user click the submit button :

    String name = editName.getText().toString().trim();

    String age = editAge.getText().toString().trim();

    Contact contact =new (name,Integer.parseInt(age));


if user didn't input age we got this error 

    java.lang.NumberFormatException: For input string: ""


