Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pcz_xyz
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
pcz_xyz
Commits
933c45e3
Commit
933c45e3
authored
Oct 25, 2022
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wydzielanie 2
parent
880b4b4c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
Wydzielanie.java
src/main/java/osoby/Wydzielanie.java
+17
-3
No files found.
src/main/java/osoby/Wydzielanie.java
View file @
933c45e3
package
osoby
;
import
java.time.DayOfWeek
;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.time.Period
;
import
java.time.format.TextStyle
;
import
java.util.Locale
;
public
class
Wydzielanie
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Teraz jest "
+
LocalDateTime
.
now
());
System
.
out
.
println
(
"Bieżąca sekunda "
+
LocalDateTime
.
now
().
getSecond
());
final
LocalDateTime
now
=
LocalDateTime
.
now
();
System
.
out
.
println
(
"Teraz jest "
+
now
);
System
.
out
.
println
(
"Bieżąca sekunda "
+
now
.
getSecond
());
DayOfWeek
dayOfWeek
=
LocalDateTime
.
now
()
.
getDayOfWeek
();
DayOfWeek
dayOfWeek
=
now
.
getDayOfWeek
();
System
.
out
.
println
(
dayOfWeek
);
System
.
out
.
println
(
dayOfWeek
.
getDisplayName
(
TextStyle
.
FULL
,
Locale
.
US
));
...
...
@@ -18,6 +22,16 @@ public class Wydzielanie {
}
private
void
run
()
{
Osoba
osoba
=
new
Osoba
(
"Ala"
,
"Kowalska"
,
LocalDate
.
now
());
System
.
out
.
println
(
osoba
);
System
.
out
.
println
(
osoba
.
getImie
()
+
" "
+
osoba
.
getNazwisko
());
wypiszWiek
(
osoba
);
}
private
void
wypiszWiek
(
Osoba
osoba
)
{
int
wiek
=
Period
.
between
(
osoba
.
getDataUrodzenia
(),
LocalDate
.
now
()).
getYears
();
System
.
out
.
println
(
"Osoba "
+
osoba
.
getImie
()
+
" ma "
+
wiek
+
" lat."
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment