Write a static method named quads that repeatedlyflips a coin until 4 heads in a
ID: 3611615 • Letter: W
Question
Write a static method named quads that repeatedlyflips a coin until 4 heads in a row are seen. You shoulduse a Random objectto give an equal chance to a head or a tail appearing. Each timethe coin is flipped, what is seen is displayed (H for heads, T forTails). When 4 heads in a row are flipped, a congratulatory messageis printed. Here are possible outputs of four calls to quads:T T T H T H H H H
Four heads in a row!
H H T T T H H H T T H T H H T H H H H
Four heads in a row!
T T T H H H H
Four heads in a row!
T H T H T T T T T H T H H H H
Four heads in a row!