Area of a Hexagon | Java program to find area of a Hexagon ; Create a function for calculating the area of the hexagon . ; Driver Code ; Length of a side
class GFG { public static double hexagonArea ( double s ) { return ( ( 3 * Math . sqrt ( 3 ) * ( s * s ) ) / 2 ) ; } public static void main ( String [ ] args ) { double s = 4 ; System . out . print ( " Area : ▁ " + hexagonArea ( s ) ) ; } }