Pages

Sunday 18 September 2016

BitSet Example

import java.util.*;                             
class Output {                                  
public static void main(String args[]) {
BitSet obj = new BitSet(5);     
for (int i = 0; i < 5; ++i)     
obj.set(i);             
   obj.clear(2);               
System.out.print(obj);          
}                                       
}                                               

Ouptput:

{0, 1, 3, 4}

No comments:

Post a Comment

Code Review

 SOLID Principles S – Single Responsibility Principle There should never be more than one reason for a class to change. O – Open-Closed Prin...