Skip to content

Commit

Permalink
Fix syntax in code examples
Browse files Browse the repository at this point in the history
Adding the `new` keyword helps newer students read the code examples, especially considering how anonymous inner classes are a more obscure feature.
  • Loading branch information
mailmindlin authored and jwbonner committed Nov 1, 2024
1 parent 1780dd1 commit 1db498d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/docs/recording-inputs/io-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -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() {});
}
}
```
Expand Down

0 comments on commit 1db498d

Please sign in to comment.