KnowledgeBoat Logo

Computer Applications

What is an assignment operator? Give an example.

Java Operators

42 Likes

Answer

Assignment operator is used to assign the value of an expression to a variable. It has the following syntax:

variable = expression;

For example,

totalMarks = 780;

The above statement assigns the value of 780 to the variable totalMarks. Any previous value stored in totalMarks variable is overwritten by this new value.

Answered By

25 Likes


Related Questions