Hackerss.com is a community of amazing hackers

Hackerss is a community for developers, data scientitst, ethical hackers, hardware enthusiasts or any person that want to learn / share their knowledge of any aspect of digital technology.

Create account Log in

Posted on

Sumar 3 numeros in Java

Sumar 3 numeros - Java:

public class AddNumbers {
   * This method add three integers.
   * @param numberOne first param to add.
   * @param numberTwo second param to add.
   * @param numberThree third param to add.
   * @return int Obtains the sum of numberOne, numberTwo and numberThree.
   public int addIntegers(int numberOne, int numberTwo, int numberThree) {
       //Variable to store the total sum
       int total = 0;
       //Sum the three numbers
       total = numberOne+ numberTwo+ numberThree;
       //Return the total
       return total;

   * One Example
   public static void main(String args[]) throws IOException {

      AddNumbers  addNumbers= new AddNumbers ();
      int sum = addNumbers.addIntegers(88, 22, 11);
      System.out.println("Sum of 88, 22 and 11 is :" + sum); //110
Enter fullscreen mode Exit fullscreen mode

Top comments (0)