The first person is wearing white cap.
when third was asked he didn't gave the answer He would have given if only both in front of him would be wearing black caps. and he would be wearing white.........
second person thought ,third didn't gave the answer it means either both or one of us(1st nd 2nd) is wearing a white cap....
if 1st would have wore black cap..then he could tell his cap is white but he didn't...
So it means 1st one was wearing a white cap bcoz if he would have wore black then either of 2nd or 3rd have answered.........