FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
training-java-future-program/Calendar_2.java at master · YuAndyTX/training-java-future-program · GitHub
This repository was archived by the owner on Dec 15, 2020. It is now read-only.
YuAndyTX
/
training-java-future-program
Public archive
forked from
bliblidotcom/training-java-future-program
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
training-java-future-program
/
Calendar_2.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (38 loc) · 749 Bytes
Breadcrumbs
training-java-future-program
/
Calendar_2.java
Copy path
File metadata and controls
43 lines (38 loc) · 749 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
import
java
.
util
.*;
public
class
Calendar_2
{
public
static
void
main
(
String
args
[])
{
if
(
args
.
length
!=
2
){
System
.
out
.
println
(
"Usage Calendar <numeric-year> <numeric-month>"
);
return
;
}
int
year
=
Integer
.
parseInt
(
args
[
0
]);
int
month
=
Integer
.
parseInt
(
args
[
1
]);
int
day
=
0
;
boolean
leapy
=
false
;
if
(
year
%
400
==
0
|| (
year
%
4
==
0
&&
year
%
100
!=
0
)){
leapy
=
true
;
}
switch
(
month
){
case
2
:
day
=
leapy
?
29
:
28
;
break
;
case
1
:
case
3
:
case
5
:
case
7
:
case
8
:
case
10
:
case
12
:
day
=
31
;
break
;
case
4
:
case
6
:
case
9
:
case
11
:
day
=
30
;
break
;
default
:
System
.
out
.
println
(
"Range Month are 1 - 12!"
);
}
System
.
out
.
println
(
"Day = "
+
day
);
}
}
Back
|
FazBrowse Home
|
New Git URL