MyClass.java
 

public class MyClass {
  public static void main(String[] args) {
    System.out.println(Math.abs(-4.7));  
  }
}

Result:
4.7