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
c668451e
Commit
c668451e
authored
Oct 25, 2022
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce method bez parametry i z parametrem Ct+Alt+M
parent
dd27aa5a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
16 deletions
+13
-16
Duplikacja2.java
src/main/java/osoby/Duplikacja2.java
+13
-16
No files found.
src/main/java/osoby/Duplikacja2.java
View file @
c668451e
...
@@ -5,31 +5,28 @@ import java.time.Period;
...
@@ -5,31 +5,28 @@ import java.time.Period;
public
class
Duplikacja2
{
public
class
Duplikacja2
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"Ala ma kota"
);
wypiszTeksty
();
System
.
out
.
println
(
"Ola ma psa"
);
wypiszTeksty
();
System
.
out
.
println
(
"Ala ma kota"
);
System
.
out
.
println
(
"Ola ma psa"
);
Osoba
a
=
new
Osoba
(
"Ala"
,
"Kowalska"
,
LocalDate
.
of
(
2011
,
3
,
4
));
Osoba
a
=
new
Osoba
(
"Ala"
,
"Kowalska"
,
LocalDate
.
of
(
2011
,
3
,
4
));
Osoba
b
=
new
Osoba
(
"Adam"
,
"Nowak"
,
LocalDate
.
of
(
2011
,
3
,
4
));
Osoba
b
=
new
Osoba
(
"Adam"
,
"Nowak"
,
LocalDate
.
of
(
2011
,
3
,
4
));
Osoba
c
=
new
Osoba
(
"Ola"
,
"Malinowska"
,
LocalDate
.
of
(
2000
,
3
,
4
));
Osoba
c
=
new
Osoba
(
"Ola"
,
"Malinowska"
,
LocalDate
.
of
(
2000
,
3
,
4
));
wypiszDaneOsoby
(
a
);
wypiszDaneOsoby
(
b
);
System
.
out
.
println
(
"Coś innego"
);
wypiszDaneOsoby
(
c
);
}
private
static
void
wypiszDaneOsoby
(
Osoba
a
)
{
System
.
out
.
println
(
"Witamy osobę "
+
a
.
getImie
()
+
" "
+
a
.
getNazwisko
());
System
.
out
.
println
(
"Witamy osobę "
+
a
.
getImie
()
+
" "
+
a
.
getNazwisko
());
System
.
out
.
println
(
"Ta osoba urodziła się w roku "
+
a
.
getDataUrodzenia
());
System
.
out
.
println
(
"Ta osoba urodziła się w roku "
+
a
.
getDataUrodzenia
());
System
.
out
.
println
(
"Wiek: "
+
Period
.
between
(
a
.
getDataUrodzenia
(),
LocalDate
.
now
()).
getYears
());
System
.
out
.
println
(
"Wiek: "
+
Period
.
between
(
a
.
getDataUrodzenia
(),
LocalDate
.
now
()).
getYears
());
System
.
out
.
println
();
System
.
out
.
println
();
}
System
.
out
.
println
(
"Witamy osobę "
+
b
.
getImie
()
+
" "
+
b
.
getNazwisko
());
private
static
void
wypiszTeksty
()
{
System
.
out
.
println
(
"Ta osoba urodziła się w roku "
+
b
.
getDataUrodzenia
());
System
.
out
.
println
(
"Ala ma kota"
);
System
.
out
.
println
(
"Wiek: "
+
Period
.
between
(
b
.
getDataUrodzenia
(),
LocalDate
.
now
()).
getYears
());
System
.
out
.
println
(
"Ola ma psa"
);
System
.
out
.
println
();
System
.
out
.
println
(
"Witamy osobę "
+
c
.
getImie
()
+
" "
+
c
.
getNazwisko
());
System
.
out
.
println
(
"Ta osoba urodziła się w roku "
+
c
.
getDataUrodzenia
());
System
.
out
.
println
(
"Wiek: "
+
Period
.
between
(
c
.
getDataUrodzenia
(),
LocalDate
.
now
()).
getYears
());
System
.
out
.
println
();
}
}
}
}
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