INNER CODE UNIT · Java
getName
AlmasB/FXTutorials · src/main/java/com/almasb/Deadlock.java:12
public String getName() {
return this.name;
}
public synchronized void bow(Friend bower) {
System.out.format("%s: %s" + " has bowed to me!%n",
this.name, bower.getName());
bower.bowBack(this);
}
public synchronized void bowBack(Friend bower) {
System.out.format("%s: %s" + " has bowed back to me!%n",
this.name, bower.getName());
}
}
public static void main(String[] args) {
Friend alphonse = new Friend("Alphonse");
Friend gaston = new Friend("Gaston");