Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
object Orientertprogrammering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
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
Markus Alexander Selander
object Orientertprogrammering
Commits
cd586a13
Commit
cd586a13
authored
1 year ago
by
Mathea Berg Vindsetmo
Browse files
Options
Downloads
Patches
Plain Diff
of5_2 lf
parent
a895ae9b
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
foreksempel/src/main/java/of5_2/lf/Chicken.java
+34
-0
34 additions, 0 deletions
foreksempel/src/main/java/of5_2/lf/Chicken.java
with
34 additions
and
0 deletions
foreksempel/src/main/java/of5_2/lf/Chicken.java
0 → 100644
+
34
−
0
View file @
cd586a13
package
of5_2.lf
;
public
class
Chicken
implements
Animal
{
private
int
age
;
private
String
name
;
public
Chicken
(
String
name
,
int
age
)
{
this
.
name
=
name
;
this
.
age
=
age
;
}
@Override
public
String
getName
()
{
return
name
;
}
@Override
public
int
getAge
()
{
return
age
;
}
@Override
public
String
makeSound
()
{
return
name
+
" sier klukk!"
;
}
@Override
public
int
compareTo
(
Animal
other
)
{
return
this
.
getAge
()
-
other
.
getAge
();
}
}
\ No newline at end of file
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