Constructor (OOPC - Part 04)
- JAVA Language -
Constructor
- Constructor එකක් කියන්නෙත් Method එකක්. හැබැයි Constructor කියන්නේ විශේෂ Method එකකි.
02. Return Type එකක් නැත.
- Constructor එකක් නිතරම run කල නොහැක. Object එකක් හැදෙන වේලාවේ විතරයි Constructor එකට Call කරන්න පුළුවන්...
- Constructor එකක් යනු, class එකේ නමින්ම සාදන return type එකක් නැති, Object එක සාදන වේලාවේ විතරක් Call කරන method එකකි.
🔅Constructor Calling
- Application එකක් run වෙන වේලාවේදි මුලින්ම වැඩ කරන්නෙ, Constructor එකයි
- Program එක run වෙන්න ආරම්භ වෙද්දිම වෙන්න අවශ්ය වැඩ අපි Code කරන්නෙ Constructor එක තුලයි.
- Return type එකක් නැති වුනාට, Constructor එකට, Values Pass කරලා Parameter/Arguments භාවිතා කරන්න පුළුවන්.
- See You in Part 5 -
😍Follow Me :-
Blog :- devindawanasinghe.blogspot.com
Facebook :- devindawanasinghe.facebook.com
YouTube :- devindawanasinghe.youtube.com
Twitter :- devindawanasinghe.twitter.com
TikTok :- devindawanasinghe.tiktok.com
Comments
Post a Comment