हिंदी

Explain the following with one example. Logical operator - Computer Applications

Advertisements
Advertisements

प्रश्न

Explain the following with one example.

Logical operator

संक्षेप में उत्तर

उत्तर

Java's logical operators (&&, ||, !) return true or false based on the outcome of expressions. 

Example:

Logical operators Symbol Example
AND &&
boolean b = (x > y) && (x > z)
OR ||
boolean p = (x <= y) || (x <= z) 
NOT !
boolean t = !(m == n)
shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 1.04: Operators in Java - EXERCISES [पृष्ठ ४४]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
अध्याय 1.04 Operators in Java
EXERCISES | Q V. 3. (c) | पृष्ठ ४४
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×