From 1db498d97c041cbe6d30c61eb4f9b95e8f883c6f Mon Sep 17 00:00:00 2001 From: Liam Feehery Date: Fri, 18 Oct 2024 07:23:25 -0500 Subject: [PATCH] Fix syntax in code examples Adding the `new` keyword helps newer students read the code examples, especially considering how anonymous inner classes are a more obscure feature. --- docs/docs/recording-inputs/io-interfaces.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/docs/recording-inputs/io-interfaces.md b/docs/docs/recording-inputs/io-interfaces.md index a504f39e..7693e11e 100644 --- a/docs/docs/recording-inputs/io-interfaces.md +++ b/docs/docs/recording-inputs/io-interfaces.md @@ -42,14 +42,14 @@ All of the IO methods include a default implementation which is used during simu public RobotContainer() { if (isReal()) { // Instantiate IO implementations to talk to real hardware - driveTrain = new DriveTrain(DriveTrainIOReal()); - elevator = new Elevator(ElevatorIOReal()); - intake = new Intake(IntakeIOReal()); + driveTrain = new DriveTrain(new DriveTrainIOReal()); + elevator = new Elevator(new ElevatorIOReal()); + intake = new Intake(new IntakeIOReal()); } else { // Use anonymous classes to create "dummy" IO implementations - driveTrain = new DriveTrain(DriveTrainIO() {}); - elevator = new Elevator(ElevatorIO() {}); - intake = new Intake(IntakeIO() {}); + driveTrain = new DriveTrain(new DriveTrainIO() {}); + elevator = new Elevator(new ElevatorIO() {}); + intake = new Intake(new IntakeIO() {}); } } ```