text: Count set bits in an integer | java program to demonstrate __builtin_popcount ( ) ; Driver code
code: import java . io . * ; class GFG { public static void main ( String [ ] args ) { System . out . println ( Integer . bitCount ( 4 ) ) ; System . out . println ( Integer . bitCount ( 15 ) ) ; } }