public class Bicycle {
private int cadence;
private int gear;
private int speed;
private int id;
private static int numberOfBicycles = 0;
p
May be what your lecturer said is regarding accessing them from outside the class not from inside the class. static variables can be accessed outside the class like this ClassName.VariableName or object.VariableName. But however the first method is preferrable.
From inside the class it's not needed you may use this keyword or classname-qualifier to disambiguate with the local variables with the same name inside methods and constructors.