Check the rules for your locality. Most places it's wrong to cycle on the sidewalk but there are exceptions. People coming out of driveways and cross streets do not expect to encounter anyone faster than walking speed so it is dangerous for the cyclist, even if legal.