Place the switch on the breadboard just as you did in the previous project. Attach one side to power, and the other side to digital pin 2 on the Arduino. You'll also need to add a 10k-Ohm resistor from ground to the switch pin that connects to the Arduino. That pull-down resistor connects the pin to ground when the switch is open, so it reads LOW when there is no voltage coming in through the switch.
So is this basically a safety precaution in the book
QuoteSo is this basically a safety precaution in the bookNo, read the reply again or read:-http://www.thebox.myzen.co.uk/Tutorial/Inputs.html