About 50 results
Open links in new tab
  1. How to add two java.lang.Numbers? - Stack Overflow

    54 I have two Numbers. Eg: Number a = 2; Number b = 3; //Following is an error: Number c = a + b; Why arithmetic operations are not supported on Numbers? Anyway how would I add these two …

  2. java - Adding the numbers inside of an array together - Stack Overflow

    Sep 11, 2021 · I am stuck at this part right now with adding the groups together. So like, Array1 A + Array2 A Array1 B + Array 2 B This is my code: import java.util.*; import java.util.Arrays; public class …

  3. java - Adding values in a for loop - Stack Overflow

    Oct 14, 2010 · I cant figure out how to add the values after it spits out the numbers. it says: Number: 5 // I typed 5 1 2 3 4 5 The sum is. So i need to add those number 1 2 3 4 5 ...

  4. java - adding only odd numbers - Stack Overflow

    Nov 15, 2012 · The only tools I have available are for statement, if, if/else if,while loop and println. I can only figure out how to print out the odd numbers. I know I want to create a variable named total to …

  5. java - Adding numbers to an array each loop - Stack Overflow

    Nov 9, 2015 · 3 Arrays in Java are of fixed size. Once you have allocated an array, adding elements is allowed only up to the number of elements that you have allocated upfront. This wouldn't be a big …

  6. java - Adding binary numbers - Stack Overflow

    Does anyone know how to add 2 binary numbers, entered as binary, in Java? For example, 1010 + 10 = 1100.

  7. java - Adding and subtracting doubles are giving strange results ...

    In Java, double values are IEEE floating point numbers. Unless they are a power of 2 (or sums of powers of 2, e.g. 1/8 + 1/4 = 3/8), they cannot be represented exactly, even if they have high precision.

  8. java - Adding integers to an int array - Stack Overflow

    I am trying to add integers into an int array, but Eclipse says: cannot invoke add(int) on the array type int[] Which is completely illogical to me. I also tried addElement() and addInt(), however

  9. java - Adding numbers in an array - Stack Overflow

    Jul 12, 2018 · In this case, I want to add two numbers in this array in to obtain a specific sum when added, let’s say, 4. I also want to output what indices are being added in order to obtain that specific …

  10. java - Adding 3 User Input Numbers together - Stack Overflow

    Feb 6, 2016 · I am doing an exercise from a site where I am trying to add 3 numbers the user inputs only using three variables. The code they let you start off with is: Scanner reader = new …