answersLogoWhite

0


Best Answer

int sum = a + b;

PS: a and b are int variables that must have been already declared and initialized.

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write an expression that computes the sum of two variables in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is it possible to write in static variables in main method in java?

Short answer: No. Only class member variables may be declared static. Local variables with a static declaration will throw an error (usually "illegal start of expression").


What does do in java?

You never write "do" seperately in Java. The only situation I can think of when you have to write "do" is in the "do while" statement. This is the syntax: do { statement(s) } while (expression);


What Java conditional expression correctly represents the mathematical expression 10 x 100?

There is no need for a conditional expression; just write it as 10 * 100.


How do you write an array that computes the product of the two numbers in java?

You don't need an array for that. Just do the multiplication, for example: result = factor1 * factor2; Or: result = 5 * 8;


What is meant by Java Lang nullpointerexeption?

The expression is termed for an error in the Java Script software provided by Oracle. It means that one of the variables passing is null, but the code still tries to use it.


What are the differences between C and Java reference variables?

Java does not have the concept of Reference Variables. We cannot access the memory location where the data is stored in Java.


What does INS do?

You never write "do" seperately in Java. The only situation I can think of when you have to write "do" is in the "do while" statement. This is the syntax: do { statement(s) } while (expression);


Does java consider the variables Hello and hello to be different variables?

no


Why there are no global variables in java?

Global variables are globally accessible. Java does not support globally accessible variables due to following reasons:The global variables breaks the referential transparencyGlobal variables creates collisions in namespac


What is the syntax of global variable in java?

There's no global variables in Java.


How we can get address of variables in Java as pointer variables in C?

At any given point of time you cann't get the address of a variables of java program. This is meant for security purpose only.


In java all variables declared using a class are?

Reference variables