Answer to Question #17323 in Java | JSP | JSF for jo smith

Question #17323
in java what does assignment mean.
Expert's answer
Assignment operator is the most common operator almost used with all programming languages. It is represented by "=" symbol in Java
which is used to assign a value to a variable lying to the left side of the
assignment operator. But, If the value already exists in that variable then it
will be overwritten by the assignment operator (=). This operator can also be
used to assign the references to the objects. Syntax of using the assignment
operator is: <variable> = <expression>;

For example:

int counter = 1;

String name = "John";

boolean rs = true;

Shape s1 = new Shape(); // creates new object

Shape s2 = s1; //assigning the reference of s1 to s2

counter = 5; // previous value is overwritten

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be the first!

Leave a comment

Ask Your question

New on Blog