p.s. this week I am on a USA/Canada tour with my new book. Details and preorder links at tomgauld.com
github.com/LpCodes/Movi...
github.com/LpCodes/Movi...
bad: sleeping an arbitrary time inside a loop to wait for something.
String action=null;
void submit(String action) {
this.action=action;
}
void doTurn() {
while(action==null) {
Thread.sleep(100);
}
doSomethingWith(action);
}
bad: sleeping an arbitrary time inside a loop to wait for something.
String action=null;
void submit(String action) {
this.action=action;
}
void doTurn() {
while(action==null) {
Thread.sleep(100);
}
doSomethingWith(action);
}
Exemple: ABuilder method "withKey(x)" returns ABuilder
BBuilder extends ABuilder with method "withSomethingElse(y) that returns BBuilder.
BBuilder.withKey("opa").withSomethingElse("y") fails to compile: withKey returns ABuilder.
Exemple: ABuilder method "withKey(x)" returns ABuilder
BBuilder extends ABuilder with method "withSomethingElse(y) that returns BBuilder.
BBuilder.withKey("opa").withSomethingElse("y") fails to compile: withKey returns ABuilder.
Exemplo: ABuilder tem método "withKey(x)" para gerar objeto A.
BBuilder extends ABuilder e tem metodo "withSomethingElse(y)" pare gerar Objeto.
BBuilder.withKey("opa").withSomethingElse("y") explode, porque withKey retorna ABuilder.
Exemplo: ABuilder tem método "withKey(x)" para gerar objeto A.
BBuilder extends ABuilder e tem metodo "withSomethingElse(y)" pare gerar Objeto.
BBuilder.withKey("opa").withSomethingElse("y") explode, porque withKey retorna ABuilder.
#java
#java