Star, ? and ! Switches
Here is a list of the types of switches found in game. They can be used as many times as you want (except for one of them)
Yellow Star Switches: They can be found by Black Bricks, and sometimes out in the open. If you step on one, a power star will appear in some location, and will stay for a short period of time. If the star disappears, you can always step on it again and make it reappear again. So you have to be quick to catch it.
Blue Star Switches: They can be seen in some places. If you ground-pound them, a few Blue Star Coins will appear for some time, then will vanish. When you use the switch once, they will be gone.
! Switches: If you step on these, somethings could occur.
? Switch: There is only one found in the game. If you hit it, all ? Blocks in game will become solid. In order to get it, you must play as Mario. Then, go into the main room in the castle and stand on the hexagon with the yellow circle and triangles around it., zoom your screen in, then look up. When you see a light coming from the roof, you will be teleported to a secret room, where the ? Switch is hidden.