1 / 23

250 likes | 349 Vues

Assignment Operator. int a, b, c; a = b = c = 5; System.out.println ( a + b + c );. Does it compile?. Assignment Operator. int a, b, c; a = b = c = 5; System.out.println ( a + b + c );. What is the output?. Assignment Operator. int a, b, c; a = b = c = 5;

Télécharger la présentation
## Assignment Operator

**An Image/Link below is provided (as is) to download presentation**
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.
Content is provided to you AS IS for your information and personal use only.
Download presentation by click this link.
While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

**Assignment Operator**int a, b, c; a = b = c = 5; System.out.println( a + b + c ); Does it compile?**Assignment Operator**int a, b, c; a = b = c = 5; System.out.println( a + b + c ); What is the output?**Assignment Operator**int a, b, c; a = b = c = 5; System.out.println( a + b + c ); Output File Edit WindowHelp 15**Assignment Operator**int a, b, c; a = b = c = 5; System.out.println( a + b + c ); right associative**Relational Operators관계 연산자**<, <=, >, >= 결과가 true / false evaluates to true / false**Relational Operators**int a = 1; boolean b = a < 2; value of b: true**Relational Operators**int a = 1; boolean b = a < 0; value of b: false**Relational Operators**int a = 1; boolean b = a <= 1; value of b: true**Relational Operators**int a = 1; int b = 2; int c = 3; boolean b = a < b < c; Does it compile?**Relational Operators**a < b < c left associative**Relational Operators**true < c ?**Relational Operators**int a = 1; int b = 2; int c = 3; boolean b = a < b &b< c;**Boolean Logical Operators논리 연산자**!, ^, &, | 결과가 true / false evaluates to true / false**! – NOT (logical complement)**boolean b; 1: b = ! true; 2: b = ! (5 > 2); in 1 and 2, value of b is ‘false’**| - OR (inclusive or)**one or the other (or both) are true**| - OR (inclusive or)**boolean b; 1: b = true | false; 2: b = false | true; 3: b = true | true; 4: b = false | false; true true true false**^ - XOR (exclusive or)**One or the other, but not both, are true**^ - XOR (exclusive or)**boolean b; 1: b = true ^ false; 2: b = false ^ true; 3: b = true ^ true; 4: b = false ^ false; true true false false**& - AND**both are true**& - AND**boolean b; 1: b = true & false; 2: b = false & true; 3: b = true & true; 4: b = false & false; false false true false**& - AND**boolean a = false; int i = 0; boolean b = a & i++ > 0; System.out.print( b + “ “ + i); Output File Edit WindowHelp false 1**&&, || - shortcut operators단락 연산자**boolean a = false; int i = 0; boolean b = a &&i++ > 0; System.out.print( b + “ “ + i); Output File Edit WindowHelp false 0**&&, || - shortcut operators**boolean a = true; int i = 0; boolean b = a ||i++ > 0; System.out.print( b + “ “ + i); Output File Edit WindowHelp true 0

More Related