Java Help plzz.

inranasingha

Well-known member
  • Jan 27, 2008
    5,818
    1,786
    113
    රජයේ රෝහල
    Meka explain karanna puluwan deyyek innwada?
    bump
    Plzz
    :(:(:(:(:(:(
    unledmh.jpg
     

    basunnaha

    Well-known member
  • Jan 19, 2011
    1,505
    278
    113
    37
    USA
    sop eke tiyena conditions deken 1k hari harinam (^ mark eken kiyanne OR) true tamai answer 1. (num1 ! = num2)
     

    pradeep0079

    Member
    Aug 19, 2010
    151
    8
    0
    here both (x>y) and (num1 != num2) are boolean conditions ,both will evaluate and return a boolean value.
    ^ operator is Boolean XOR opeartor ,it worka as follows

    If x is true and y is false, the result is true.
    If x is false and y is true, the result is true.
    Otherwise, the result is false.
    Both x and y are evaluated before the test.

    System.out.println((x > y) ^ (num1 != num2));

    so above expression will true since (x>y) =false and (num1!=num2) =true
    according to send rule
    for more information visit this site:
    http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter02/operators.html

    hope this helps.
     
    • Like
    Reactions: inranasingha

    inranasingha

    Well-known member
  • Jan 27, 2008
    5,818
    1,786
    113
    රජයේ රෝහල
    machan ^ kiyanne exclusive OR kiyana eka,
    a kiyanne depaththe thiyena deken 1k pamanak true unama thamayi true venne,
    dekama true unama falls,a vagema dekama falls unath falls,it's like a XOR gate in logic


    528-logic_gates_19.jpg

    here both (x>y) and (num1 != num2) are boolean conditions ,both will evaluate and return a boolean value.
    ^ operator is Boolean XOR opeartor ,it worka as follows

    If x is true and y is false, the result is true.
    If x is false and y is true, the result is true.
    Otherwise, the result is false.
    Both x and y are evaluated before the test.

    System.out.println((x > y) ^ (num1 != num2));

    so above expression will true since (x>y) =false and (num1!=num2) =true
    according to send rule
    for more information visit this site:
    http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part1/Java/Chapter02/operators.html

    hope this helps.

    tx machan
    pin sidda wenawa
    :D:D:D:D:D