local variable type inference changes (#1041)
local variable type inference changes for template method design pattern
This commit is contained in:
parent
af8c5ed0dd
commit
03e1e92b52
@ -40,7 +40,7 @@ public class App {
|
||||
* @param args command line args
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
HalflingThief thief = new HalflingThief(new HitAndRunMethod());
|
||||
var thief = new HalflingThief(new HitAndRunMethod());
|
||||
thief.steal();
|
||||
thief.changeMethod(new SubtleMethod());
|
||||
thief.steal();
|
||||
|
@ -45,7 +45,7 @@ public abstract class StealingMethod {
|
||||
* Steal
|
||||
*/
|
||||
public void steal() {
|
||||
String target = pickTarget();
|
||||
var target = pickTarget();
|
||||
LOGGER.info("The target has been chosen as {}.", target);
|
||||
confuseTarget(target);
|
||||
stealTheItem(target);
|
||||
|
Loading…
x
Reference in New Issue
Block a user