Java BitSet andNot() methodThe andNot() method of Java BitSet class is used to clear the entire bit in this BitSet whose corresponding bit is set in the specified BitSet. Syntax:Parameter:
Returns:NA Exception:NullPointerException - If null parameter will pass in the method. Compatibility Version:Java 1.2 and above Example 1Output: bitset1: {0, 1, 2, 3, 4} bitset2: {1, 3, 5, 6, 7} result bitset after andNot: {0, 2, 4} Example 2This method throws a NullPointerException if we pass a null parameter. Output: Exception in thread "main" java.lang.NullPointerException at java.util.BitSet.andNot(Unknown Source) at BitSetAndNotExample2.main(BitSetAndNotExample2.java:16) bitset1: {0, 1, 2, 3, 4} Next TopicJava-bitset-and-method |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India