answersLogoWhite

0

public class AddNumbers {

public static void main(String[] args){

int val1 = Integer.parseInt(args[0]);

int val2 = Integer.parseInt(args[1]);

System.out.println("Sum of the two numbers is: " + (val1 + val2));

}

}

The above class takes two numbers as arguments to the class and displays the sum of those two numbers on the console.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

Why we write java program using classes?

Classes are well organised functions in java which help discriminate between two different functions.


What do you call the result adding two numbers?

Adding two or more numbers together gives you a sum.


Why there are two numbers of classes in java class programmes?

A Java source code file can contain any number of classes. However, only one one of them can contain the main method which is called upon execution after compilation of the source code. However, this is a bad practice that needs to be avoided. Generally, one of those classes is the actual class while the other is a test class.


What do you call the result of adding of to numbers?

The result of adding two numbers is their sum.


When adding two numbers you get a sum but when subtracting two numbers what do you get?

a difference


When adding two numbers you get a sum but when MULTIPLYING two numbers what do you get?

the PRODUCT :)


What is the symbol for adding two numbers together?

+ is the symbol for adding two numbers together.It is usually called the plus symbol.


IF you are adding two rational numbers with different signs?

Then you are adding two rational numbers with different signs! No big deal!


What program to add two Complex numbers in java?

I found this class that defines complex numbers, and has the capacity of adding them, and much more: http://www.math.ksu.edu/~bennett/jomacg/c.html Basically, you define a class with two fields, one for the real part, and one for the imaginary part.


How do you input an operator between two numbers in java?

You type it in with your keyboard.


What is it called when you add two numbers two together?

Adding


What is it called when two numbers are added?

When adding numbers, the total is the sum. The sum of two odd numbers is even.