Answers for "Consider the following method. public static int getOnes(int x) { return Math.abs(x) % 10; }"

3

abs in java

public class Test { 

   public static void main(String args[]) {
      Integer a = -8;
      double d = -100;
      float f = -90;

      System.out.println(Math.abs(a));
      System.out.println(Math.abs(d));     
      System.out.println(Math.abs(f));    
   }
}
Posted by: Guest on March-01-2020

Code answers related to "Consider the following method. public static int getOnes(int x) { return Math.abs(x) % 10; }"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language