What was medieval castles made of?

Medieval castles were built for protection and not for comfort. The first castles were built using wood but, were found to burn easily. Stone was then used in replacement of wood.