Good question! As I dont know the dog, how old is he, what sort of exercise is he getting and how often, how big is he, is he an indoor dog or outdoor? what have you tried so far to curb his barking?
Im surprised people havent asked lots more question before recommending a shock collar but...