(1) GirlScout gs = new GirlScout("Rose", 2000, 20.50);
(2) GirlScout gs = new GirlScout();
gs.setName("Rose");
gs.setID(2000);
gs.setDue(20.50);
Other than making different format in the GirlScout class, is there any difference in the above two ways in writing.
What is the difference between two
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

VulpesRank #55 · 29.2K reputationPosted Jul 21, 2012, 7:12 AM EDT
However, providing a constructor to initialize fields to sensible values is always good practice IMO. It's much easier for the user to write code such as (1) rather than (2).
Posted Jul 21, 2012, 7:15 AM EDT