Advertisements
Advertisements
Question
Distinguish between (p != q) and !(p == q).
Distinguish Between
Solution
S. No. | (p != q) | !(p == q) |
1. | This condition will be true if p and q are not equal. | Even if p and q are equal, false is returned because of the (NOT !) operator. |
2. | Example:
|
Example:
|
shaalaa.com
Is there an error in this question or solution?
Chapter 1.04: Operators in Java - EXERCISES [Page 44]