We all know that when we are importing a class of a package in another package , the methods which are public are only available and we can use it . But suppose the method has default access specifier , yet we can use the method . With default access specifier it is only available to classes inside the same package and not in any other packages . Then how is it possible ?? For instance , I import the java.util.BitSet . Then I instantiate bits (an object) BitSet bits=new BitSet(16) ; After that if I want to use set() like bits.set() how can I use it since set() is not public .