Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
contact_manager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SECOND
java
contact_manager
Commits
46ee0f6e
Commit
46ee0f6e
authored
2 years ago
by
jonas.stirnema
Browse files
Options
Downloads
Patches
Plain Diff
Testing some things
parent
adbc2560
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/Contact.java
+36
-1
36 additions, 1 deletion
src/Contact.java
src/DynArray.java
+1
-2
1 addition, 2 deletions
src/DynArray.java
with
37 additions
and
3 deletions
src/Contact.java
+
36
−
1
View file @
46ee0f6e
...
...
@@ -10,8 +10,29 @@ public class Contact {
private
DynArray
socials
;
private
String
job
;
// CONSTRUCTORS
public
Contact
()
{
setFname
(
new
String
(
""
));
setNames
(
new
DynArray
(
new
String
[]
{
""
}));
setAddress
(
new
String
(
""
));
setPhoneNumbers
(
new
DynArray
(
new
String
[]
{
""
}));
setEmails
(
new
DynArray
(
new
String
[]
{
""
}));
setSocials
(
new
DynArray
(
new
String
[]
{
""
}));
setJob
(
new
String
(
""
));
}
public
Contact
(
String
name
,
DynArray
names
,
String
address
,
DynArray
phone
,
DynArray
email
,
DynArray
socials
,
String
job
)
{
setFname
(
name
);
setNames
(
names
);
setAddress
(
address
);
setPhoneNumbers
(
phone
);
setEmails
(
emails
);
setSocials
(
socials
);
setJob
(
job
);
}
// GETTERS, SETTERS
public
String
getFname
()
{
return
fname
;
}
...
...
@@ -92,4 +113,18 @@ public class Contact {
}
}
// SHOW-ERS
public
void
showFname
()
{
System
.
out
.
println
(
"Family name: "
+
this
.
fname
);
}
public
void
showNames
()
{
System
.
out
.
print
(
"Names: "
);
this
.
names
.
show_it
();
}
public
void
showAddress
()
{
System
.
out
.
println
(
"Family name: "
+
this
.
fname
);
}
}
This diff is collapsed.
Click to expand it.
src/DynArray.java
+
1
−
2
View file @
46ee0f6e
...
...
@@ -55,13 +55,12 @@ public class DynArray {
}
public
String
intoString
()
{
String
s
=
"
[
"
;
String
s
=
""
;
for
(
int
i
=
0
;
i
<
this
.
size
;
i
++)
{
s
=
s
.
concat
(
array
[
i
]);
s
=
s
.
concat
(
", "
);
}
s
=
s
.
concat
(
" ]"
);
return
s
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment