Posts

Showing posts from April 2, 2023

Constructor (OOPC - Part 04)

Image
   - JAVA  Language -   Constructor Constructor එකක් කියන්නෙත් Method එකක්. හැබැයි Constructor කියන්නේ විශේෂ Method එකකි.                         01. Class එකේ නමින්ම Constructor එක සෑදිය යුතුය.                        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.c...

Parameters & Arguments (OOPC - Part 03)

Image
   - JAVA  Language - Parameters & Arguments 🔅 Method,         public static void main (String [] args){  → Main method    }           void myheight (){  →  myheight නම් method එක ,       } Method එකක් වෙන්න නම් අනිවාර්යයෙන්ම තිබිය යුතු අංග දෙකක් ඇත         එනම්,                  1. return type                 2. method name (Parameter)          Example :-                                void  →   return type                   myheight()  →   method name (Parameter) 🔅 Return Type , void   →  default ( Any Data Type / String ඇතුළුව ) data Type / String  →   (...

OOP Concepts - Part 02

Image
   - JAVA  Language -   Object Creation In Java, an object can be generated only if there is a class. Only a class can be converted into an object.                                           Human h1 = new Human();              …  h2 …               …  h3 …       Type - 01      Type - 02 ---------------------------------------------------------------------------------------------------------------------------   Primitive Data Types    🔅  Types/formats used to hold data.  Integer  Float  Binary (1/0)                                    1  byte - Integer                       ...

OOP Concepts - Part 01

Image
 - JAVA  Language -         Class  Hierarchy     Object     Class    Method    Variable     Standards Class :   The first letter is uppercase             example :-  Capital Variable : The first letter is lowercase            example :-  capital Method :  The first letter is lowercase and contains the parameter                 list             example :-  capital()