java convert edittext to double

Java
 double n2Var = Double.parseDouble(n2.getText().toString());
Source

Also in Java: