If I have an Employee class with a default constructor:
Employee
private String firstName; public Employee(){}
and a setter:
You can also use this syntax:
Employee employee = new Employee() {{ setFirstName("John"); }};
Though keep in mind that it's going to create an anonymous inner class and probably isn't what you want.