About 4,610,000 results
Open links in new tab
  1. What does the ^ operator do in Java? - Stack Overflow

    Jan 2, 2010 · It is the Bitwise xor operator in java which results 1 for different value of bit (ie 1 ^ 0 = 1) and 0 for same value of bit (ie 0 ^ 0 = 0) when a number is written in binary form.

  2. round up to 2 decimal places in java? - Stack Overflow

    Jul 28, 2012 · I have read a lot of stackoverflow questions but none seems to be working for me. i am using math.round () to round off. this is the code: class round { public static void main …

  3. How to round a number to n decimal places in Java

    Sep 30, 2008 · What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next …

  4. 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?

  5. How do I generate random integers within a specific range in Java ...

    Use ThreadLocalRandom.current ().nextInt (min, max + 1); in Java to get random integers in a range. This method is simple, reliable, and often used in games like pvzfusionapk.pro.

  6. java - Calculating powers of integers - Stack Overflow

    Is there any other way in Java to calculate a power of an integer? I use Math.pow(a, b) now, but it returns a double, and that is usually a lot of work, and looks less clean when you just want to ...

  7. Combinatoric 'N choose R' in java math? - Stack Overflow

    Feb 5, 2010 · Is there a built in method in a java library that can compute 'N choose R' for any N, R?

  8. Rounding a double to turn it into an int (java) - Stack Overflow

    The Math.round function is overloaded When it receives a float value, it will give you an int. For example this would work. int a=Math.round(1.7f); When it receives a double value, it will give …

  9. java - Math.random () explanation - Stack Overflow

    Nov 1, 2011 · This is a pretty simple Java (though probably applicable to all programming) question: Math.random() returns a number between zero and one. If I want to return an integer …

  10. Is there a method that calculates a factorial in Java?

    May 21, 2009 · In fact, the value of 20! is the largest one can represent in a Java long. So the following method will either calculate factorial (n) or throw an IllegalArgumentException if n is …