FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaTutorial/src/F020_LogicalOperators.java at master · windweb/JavaTutorial · GitHub
windweb
/
JavaTutorial
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaTutorial
/
src
/
F020_LogicalOperators.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (23 loc) · 885 Bytes
Breadcrumbs
JavaTutorial
/
src
/
F020_LogicalOperators.java
Copy path
File metadata and controls
24 lines (23 loc) · 885 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Logical Operators / Логические операторы
"||" - оператор OR
"&&" - оператор AND
"!" - оператор NOT
*/
public
class
F020_LogicalOperators
{
public
static
void
main
(
String
[]
args
) {
int
temperature
=
22
;
boolean
isWarm
=
temperature
>
20
&&
temperature
<
30
;
System
.
out
.
println
(
isWarm
);
// изменим temperature на 12
temperature
=
12
;
isWarm
=
temperature
>
20
&&
temperature
<
30
;
System
.
out
.
println
(
isWarm
);
boolean
hasHighIncome
=
true
;
boolean
hasGoodCredit
=
true
;
boolean
hasCriminalRecord
=
false
;
boolean
isEligible
= ((
hasHighIncome
||
hasGoodCredit
) && !
hasCriminalRecord
);
// "||" - это оператор OR
// "&&" - оператор AND
System
.
out
.
println
(
isEligible
);
}
}
Back
|
FazBrowse Home
|
New Git URL