About 817,000 results
Open links in new tab
  1. Why can't my program access the math methods in Java?

    May 22, 2013 · If a file is called Math.java (which it seems to be), it must contain a class called Math. Take a look at this post. Java is looking for a file called ./Math.java, which doesn't …

  2. Should I import a math library, and if so how? - Stack Overflow

    E and PI are not functions, they're static fields (data members). That code will output their values correctly. You don't have to import anything, the Math class is in the java.lang package, which …

  3. Is the Math class a standard class of Java? - Stack Overflow

    Oct 19, 2014 · I know that String, Integer and Double are standard classes of Java, but would Math fall into this category? You definitely do not have to import it like the Scanner class, …

  4. what is the difference between the java.lang.Math class and the …

    The package java.math contains math related classes like BigDecimal.java and BigInteger.java While the class java.lang.Math is an actual Java class which resides in the packae 'java.lang'

  5. how to use math.pi in java - Stack Overflow

    Sep 26, 2012 · how to use math.pi in java Asked 13 years, 3 months ago Modified 6 years, 4 months ago Viewed 583k times

  6. class - What is Math in Java? - Stack Overflow

    Mar 15, 2018 · Math is name of class placed in java.lang package which is why we don't need to import it and can use in our code directly (just like any other classes from that package, like for …

  7. Getting random numbers in Java - Stack Overflow

    I would like to get a random value between 1 to 50 in Java. How may I do that with the help of Math.random();? How do I bound the values that Math.random() returns?

  8. java - Math.random () v/s Random class - Stack Overflow

    The Math class in Java has a method, Math.random() which returns a pseudorandom number between 0 and 1. There is also a class java.util.Random which has various methods like …

  9. math - Calculate Average Java - Stack Overflow

    Nov 11, 2014 · I'm trying to calculate the average of the student scores and as it stands I'm struggling with the calculation part. In my assignment I was asked to caulculate the avg age of …

  10. java - Trying to instantiate Math class - Stack Overflow

    All important methods of java.lang.Math are static so you don't need instance of that class to invoke them. Just use Math.abs(x - y) or in your case java.lang.Math.abs(x - y) to specify that …