can I use a momentary button on a analog pin?

so I will still do the 5v and a 220 ohm on one leg of the button and the input pin (Ao-A15) on the other leg of the button? will I need to change the code any other and declaring the analog pin as a in not a out?