79417650

Date: 2025-02-06 11:10:33
Score: 1
Natty:
Report link

It completely depends on the use case and logic. I prefer to call it after new X() as object will have data after some setters are called.

X obj = new X();
obj.setName("xyz");
obj.setId(1);
validator.validate(obj);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Yasin Ahmed