Driver code
public static void main ( String args [ ] ) { String s [ ] = { " hate " , " love " , " peace " , " love " , " peace " , " hate " , " love " , " peace " , " love " , " peace " } ; int n = s . length ; System . out . println ( countWords ( s , n ) ) ; } }