Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
programming help>>>
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Jolly_Roger" data-source="post: 16389073" data-attributes="member: 197784"><p>machan C# wala wage multiple inheritance support karanne nathi welawata multiple classes walin methods call karanna thamai use karanne. runtime polymorphism kiyalath kiyanawa.</p><p></p><p>me wage</p><p></p><p>public class FileLog : ILog { </p><p></p><p> public void Log(string text) </p><p> {</p><p> // write text to a file </p><p> }</p><p> } </p><p></p><p>public class DatabaseLog : ILog </p><p>{ </p><p> public void Log(string text)</p><p> { </p><p> // write text to the database </p><p> } </p><p>} </p><p></p><p>public interface ILog </p><p>{ </p><p>void Log(string text); </p><p>} </p><p></p><p>public class SomeOtherClass </p><p>{ </p><p>private ILog _logger; </p><p>public SomeOtherClass(ILog logger) </p><p> { </p><p> // i don't know if logger is the FileLog or DatabaseLog </p><p> // but i don't need to know that as long as its implementing ILog this._logger = logger; logger.Log("Hello World!);</p><p> } </p><p> }</p><p></p><p>interface ekak kiyanne contract ekak. mokakhari class ekak interface ekak inherit karnawa nam eke thiyana hama proprty ekakma class eke implement karanna ona.</p><p></p><p>interfaces use kalama loose coupling achieve karanna puluwan. <img src="/styles/default/xenforo/smilies/default/happy.gif" class="smilie" loading="lazy" alt=":)" title="Happy :)" data-shortname=":)" /><img src="/styles/default/xenforo/smilies/default/happy.gif" class="smilie" loading="lazy" alt=":)" title="Happy :)" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="Jolly_Roger, post: 16389073, member: 197784"] machan C# wala wage multiple inheritance support karanne nathi welawata multiple classes walin methods call karanna thamai use karanne. runtime polymorphism kiyalath kiyanawa. me wage public class FileLog : ILog { public void Log(string text) { // write text to a file } } public class DatabaseLog : ILog { public void Log(string text) { // write text to the database } } public interface ILog { void Log(string text); } public class SomeOtherClass { private ILog _logger; public SomeOtherClass(ILog logger) { // i don't know if logger is the FileLog or DatabaseLog // but i don't need to know that as long as its implementing ILog this._logger = logger; logger.Log("Hello World!); } } interface ekak kiyanne contract ekak. mokakhari class ekak interface ekak inherit karnawa nam eke thiyana hama proprty ekakma class eke implement karanna ona. interfaces use kalama loose coupling achieve karanna puluwan. :):) [/QUOTE]
Insert quotes…
Verification
Nawa warak dahaya keeyada? (Namaya wadi kireema dahaya)
Post reply
Top
Bottom