It totally depends on where you are. You'll have to look up your local laws. In some places you are not allowed to ride on sidewalks period. Some places you have to walk your bike in crosswalks, some places riding is OK.
"Sharing the road means getting along, not getting ahead" - 1994 Washington State Driver's Guide