|
|
|
|
|
|
|
|
this.phoneNumber = phoneNumber; |
|
|
this.phoneNumber = phoneNumber; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public static void printVisitenkarte(Visitenkarte a){ |
|
|
|
|
|
|
|
|
public void printVisitenkarte(){ |
|
|
System.out.println("-----------------------------------"); |
|
|
System.out.println("-----------------------------------"); |
|
|
System.out.println(a.name + ", " + a.firstName); |
|
|
|
|
|
System.out.println(a.job + ", " + a.age); |
|
|
|
|
|
System.out.println(a.address); |
|
|
|
|
|
System.out.println(a.phoneNumber); |
|
|
|
|
|
|
|
|
System.out.println(name + ", " + firstName); |
|
|
|
|
|
System.out.println(job + ", " + age); |
|
|
|
|
|
System.out.println(address); |
|
|
|
|
|
System.out.println(phoneNumber); |
|
|
System.out.println("-----------------------------------"); |
|
|
System.out.println("-----------------------------------"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String toString(){ |
|
|
|
|
|
String contact = "-----------------------------------\n" + |
|
|
|
|
|
name + ", " + firstName + "\n" + |
|
|
|
|
|
job + ", " + age + "\n" + |
|
|
|
|
|
address + "\n" + |
|
|
|
|
|
phoneNumber + "\n" + |
|
|
|
|
|
"-----------------------------------"; |
|
|
|
|
|
return contact; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
public static void main(String[] args) { |
|
|
Visitenkarte tabea = new Visitenkarte("Strauss", "Tabea", "student", "27", "Untere Baustr. NBG", "017712345"); |
|
|
Visitenkarte tabea = new Visitenkarte("Strauss", "Tabea", "student", "27", "Untere Baustr. NBG", "017712345"); |
|
|
printVisitenkarte(tabea); |
|
|
|
|
|
|
|
|
tabea.printVisitenkarte(); |
|
|
|
|
|
System.out.print(tabea.toString()); |
|
|
|
|
|
System.out.println("Did it work?"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|