Depends on what you want to do. Ride on the sidewalk? OK on a bike (unless there is a specific prohibition), not in a car. Pass a school bus? You can hop off and walk, but otherwise, same law applies to both. Ride on the shoulder? OK on a bike, but not in a car. Use common sense. Your safety should come first.