hepatitis B is only transmitted through blood, so it is mostly a sexually transmitted disease.
Hepatitis A on the other hand is transmitted through food, but then it is not chronicle and less dangerous.
In both cases, all you need to do to prevent it is a few shots. I was told to do that when I traveled to China and Taiwan and I have never had any problem.