Find the maximum number of handshakes | Java program to find maximum number of handshakes . ; Calculating the maximum number of handshake using derived formula . ; Driver code
class GFG { static int maxHandshake ( int n ) { return ( n * ( n - 1 ) ) / 2 ; } public static void main ( String [ ] args ) { int n = 10 ; System . out . println ( maxHandshake ( n ) ) ; } }