Posts

If You Can Gain Even A Little Bit Of Knowledge From This, That Is My Happiness.

Image
  A welcome blog post introduces your blog to the world. It shouldn’t consist only of a brief announcement, though, because you’re setting the stage for future content. You must let people know that you’re an authority in your industry and that you’re capable of producing meaty, engaging content. Think of your welcome or introductory blog post as your audition. You only get one chance to get it right, and your audience will decide based on its content whether they want to return to your blog. Don’t let your anxiety take over, though, because we’re going to share a formula that works.

Method Overriding & Super Keyword (OOPC - Part 07)

Image
  - JAVA  Language -  Method Overriding Super Class එකකින් Sub Class එකකට ලබා ගන්න Method එකක Body එක වෙනස් කිරීම Method Overriding වේ. Method Overriding වලදී සෑම විටම ක්‍රියාත්මක වන්නේ Object එකට අදාල Method පමණයි        Output  →  Using Ladder!      Super  = Parent     Sub = Child      ------------------------------------------------------------------------------------------------------- Super Keyword Sub Class එකක සිට Super Class එකේ Constructor එක Call කිරීමට Super Keyword එක භාවිතා කරයි. Super Keyword එකෙන් හැමවේලේම Call කරන්නේ Super Class එකට. Super Class එකේ Method සහ Variable සියල්ලම, Sub Class එකේ සිට Super Keyword එකෙන් Access කරන්න පුළුවන්.     Example Code :- Super();   →  Super Class එකේ තිබෙන Methods  සියල්ලම Run කරන එක සිදු කරයි. Super.climb(); /   Super.climb();  →  අදාල Method එකට පමණක් Call කරලා අදාල Method එක පමණක් Run කරන එක සිදු...

Inheritance (OOPC - Part 06)

Image
  - JAVA  Language -     Inheritance එක් Class එකක තිබෙන දේවල් තවත් Class එකකට යොදා ගැනීම Inheritance ලෙස හැදින්විය හැක. එම ක්‍රියාවලිය සිදු කර ගැනීමට, Class දෙක අතර සම්බන්ධතාවයක් සාදා ගත යුතුය.එම සම්බන්ධතාවය සාදා ගැනීමට extends යන keyword එක යොදාගනී. එවිට, පළමු Class එක Super Class ලෙසද, අලුත් Class එක sub Class ලෙසද හදුන්වයි.   Simple Example : -   Code Example : - - See You in Part 7 - 😍Follow Me :- Blog  :-  devindawanasinghe.blogspot.com Facebook  :-  devindawanasinghe.facebook.com YouTube  :-  devindawanasinghe.youtube.com Twitter  :-  devindawanasinghe.twitter.com TikTok  :-  devindawanasinghe.tiktok.com

Method Overloading (OOPC - Part 05)

Image
  - JAVA  Language -    Method Overloading එකම Class එකක, එකම method එක නැවත වතාවක් සැසඳීමේදී Method Overloading Concept එක භාවිතා කරයි. Parameter එක වෙනස් කිරීමෙන් Method Overloading සිදු කළ හැකිය.එය Method Signature එක ලෙස හදුන්වයි.     Example : - For Method Overloading     Access Modifiers Classes , Methods , Variables , Access කරන්න දෙන Security එක Modifiers ලෙස හදුන්වයි. Modifiers වර්ග 04 කි. 1.  Public 2. Protected 3. Default 4. Private 01 ) Public  →  අදාල Project එකේ, ඒ Class එකේ ( සම්බන්ධ වන සියලුම Class ) සිටින                           ඕනම කෙනෙක්ට Use කරන්න පුළුවන්. 02 )  Protected  →  අදාල Class එකේ අයටයි, Package (folder) එකේ අයටයි, Sub Class                             (join class) වලටයි පමණක් Use කරන්න පුළුවන්. 03 )  Default  →  අදාල Class...

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()