English

What is the difference between = and ==? - Computer Applications

Advertisements
Advertisements

Question

What is the difference between = and ==? 

Distinguish Between

Solution

S. No. = ==
1. Assignment (=) Equals (==)
2. This is the assignment operator. This is a relational operator.
3. Example: 
a = b;
// assigns the value of b to a
Example: 
boolean w = (a == b) 
// w = true if a and b are equal, otherwise w = false
shaalaa.com
  Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 44]

APPEARS IN

Avichal Computer Applications [English] Class 10 ICSE
Chapter 1.04 Operators in Java
EXERCISES | Q V. 5. (b) | Page 44
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×