can I define setter method to return this rather than void?
Like:
ClassA setItem1() { return this; } ClassA setItem2() { return this; }
No reason you couldn't do that. Personally, if the setters are being used during object creation, I'd name them withItem1() and withItem2().
ClassA obj = new ClassA().withItem1(item1).withItem2(item2);
Makes it a bit clearer (to me anyway) what the intent of the methods are.