Thread: Some Java help
View Single Post
02-09-2009   #5 (permalink)
Yukipyon
Let's Pie Creation!
Yukipyon's Avatar
Games
MapleStoryS4 LeagueEden Eternal
 
Join Date: Nov 2008
Location: Beyond that hill
Posts: 730
iTrader: (0)
Yukipyon is a splendid one to beholdYukipyon is a splendid one to beholdYukipyon is a splendid one to beholdYukipyon is a splendid one to beholdYukipyon is a splendid one to beholdYukipyon is a splendid one to beholdYukipyon is a splendid one to behold
IGN: Aokawa
Default

Well, it's good practice to let your constructor method assign values to your instance variables. You should use "set" methods if you want to change the values of your instance variables later on in the program, or if your constructor doesn't assign values to your instance variables.

So, "set" methods are mainly used when you want to be able to change the values of an object's instance variables. But, if you don't plan to change the values of your instance variables after you initialize them, then you don't really need to use "set" methods; just let the constructor do the work. ^.^;


Sorry, if my explanation isn't very good. >.<
__________________
"...And just like that, he became the king of the world."