Does it mean I have a cavity?

When I eat candy or anything sweet like cookies or a chocolate bar my teeth in the back start feeling weird.