Can object method call be done simultaneously with object instantiation? <p>I'm trying to use java class <code>BitSet</code> as a field for a customized class. And I want the class to use a default BitSet with all bits set.</p> <pre><code>import java.util.BitSet; public class MyClass { private BitSet mask; public MyClass() { this(new BitSet(4)); // want to set all bits first // something like // this( new BitSet(4).set(0,3) ); } public MyClass(BitSet mask) { this.mask = mask; } } </code></pre> <p>By default <code>BitSet</code> constructor unsets all bits. So before I send it as an anonymous object, I would like call <code>set(int, int)</code> method to set all bits. I know that I could simply initialize the field <code>mask</code> to a new <code>BitSet</code> and then call <code>set(int, int)</code> method from there. </p> <p>However, in general I'm wondering is it possible to access an instance method at time of object instantiation?</p>