-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFood.java
More file actions
25 lines (21 loc) · 742 Bytes
/
Copy pathFood.java
File metadata and controls
25 lines (21 loc) · 742 Bytes
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
//-----------------------------------------------------------------//
public class Food {
//---------------------------------------------------------------//
// TODO: attributes and constructor
String Oberbegriff;
String Bezeichnung;
public Food(String Oberbegriff, String Bezeichnung) {
this.Oberbegriff = Oberbegriff;
this.Bezeichnung = Bezeichnung;
}
//---------------------------------------------------------------//
public int hashCode() {
// TODO: implementation
return Oberbegriff.hashCode() + Bezeichnung.hashCode();
}
//---------------------------------------------------------------//
public String toString() {
// TODO: implementation
return Oberbegriff + " : " + Bezeichnung;
}
}