FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaExercises/Java 1/homeWork/Lesson1HomeWork.java at master · biblelamp/JavaExercises · GitHub
biblelamp
/
JavaExercises
Public
Notifications
You must be signed in to change notification settings
Fork
130
Star
153
Code
Issues
1
Pull requests
9
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaExercises
/
Java 1
/
homeWork
/
Lesson1HomeWork.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
44 lines (39 loc) · 977 Bytes
Breadcrumbs
JavaExercises
/
Java 1
/
homeWork
/
Lesson1HomeWork.java
Copy path
File metadata and controls
44 lines (39 loc) · 977 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* Java 1. Homework 1
*
* @author Sergey
* @version 6.9.2021
*/
class
Lesson1HomeWork
{
public
static
void
main
(
String
[]
args
) {
printThreeWords
();
checkSumSign
();
printColor
();
compareNumbers
();
}
static
void
printThreeWords
() {
System
.
out
.
println
(
"Orange"
);
System
.
out
.
println
(
"Banana"
);
System
.
out
.
println
(
"Apple"
);
}
static
void
checkSumSign
() {
int
a
=
5
;
int
b
=
3
;
System
.
out
.
println
(
"The sum is "
+ (
a
+
b
>=
0
?
"positive"
:
"negative"
));
}
static
void
printColor
() {
int
value
=
101
;
if
(
value
<=
0
) {
System
.
out
.
println
(
"Red"
);
}
else
if
(
value
<=
100
) {
System
.
out
.
println
(
"Yellow"
);
}
else
{
System
.
out
.
println
(
"Green"
);
}
}
static
void
compareNumbers
() {
int
a
=
10
;
int
b
=
10
;
System
.
out
.
println
(
a
>=
b
?
"a >= b"
:
"a < b"
);
}
}
Back
|
FazBrowse Home
|
New Git URL