Browse Source

updated file

master
straussta76745 5 years ago
parent
commit
0ea8f66737
1 changed files with 19 additions and 6 deletions
  1. 19
    6
      src/Visitenkarte.java

+ 19
- 6
src/Visitenkarte.java View File

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?");
} }





Loading…
Cancel
Save