Can a stud have a power line IN it?
Power lines can be run either through a hole drilled through the stud (i.e. horizontally) or stapled along the edge of the stud (i.e. vertically).  

Horizontal runs are generally used to connect multiple sockets in the same room.  For normal outlets at about 1' above floor level, the wiring will usually be a few inches above the outlets, but you could have them at other heights too, like if you have a kitchen or bathroom on the other side of the wall, or wall sconces for lighting.

Vertical runs of wire generally bring power into a room from wire runs (that eventually lead back to the service panel) in the attic, crawlspace/basement or the space between floors.

If it's running through the stud, there should be a metal plate attached to the front of the stud to prevent you from driving nails or screws into the power line.  



Of course, things aren't always done the way they should be, so you can detect if you have these plates with a strong magnet.