As exposure to UVA and UVB cause skin cancer, one might not consider this disease to be hereditary. However, some of the cancers occur in poorly pigmented individuals. As you inherit skin colour, you can consider genetics to be playing a role here.