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
Plan your Crypto & Forex entries before you take the trade
romeshnonis
Updated:
Today at 3:20 AM
RHCSA, RHCE, AWS, Docker, Kubernetes Training
Sanjeewani95
Updated:
Tuesday at 10:28 AM
🛡️ Kaspersky Antivirus – 1 Year / 1 Device | Rs. 2,300 | Only 9 Left
KSPathirana
Updated:
Sep 7, 2026
Ad icon
Professional CCTV Installation Service
Techguy231
Updated:
Sep 6, 2026
Ad icon
I'll research & write an article - Rs. 2000 onwards
Blogerwiki
Updated:
Sep 3, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
Education
ElaKiri Programmer's Club
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="DJvodka" data-source="post: 16463230" data-attributes="member: 186185"><p>උබ ඕක තේරුම් අරන් තියෙන්නෙ වැරදියට. </p><p><span style="color: Red">Rectangle rec = new Rectangle(){};</span></p><p></p><p>මේ කරල තියෙන්නෙ anonymous inner class එකක් හදල ඒකෙන් අලුත් object එකක් හදල. පහල code එක බලල idea එකක් ගන්න.</p><p></p><p>[CODE]</p><p>abstract class Car{</p><p> </p><p> abstract protected void startEngine(); //Different Cars have their own ways of starting the engine</p><p> </p><p> protected void turnoffGPS(){</p><p> System.out.println("Shutting off GPS");</p><p> }</p><p> </p><p>}</p><p></p><p>class BMW extends Car{</p><p> protected void startEngine(){</p><p> System.out.println("Starting by voice recognition");</p><p> }</p><p>}</p><p></p><p>class Allion extends Car {</p><p> protected void startEngine(){</p><p> System.out.println("Something wrong... :P");</p><p> }</p><p>}</p><p></p><p>class Test {</p><p> public static void main(String args[]){</p><p> Car c = new BMW();</p><p> c.startEngine();</p><p> c.turnoffGPS();</p><p> c = new Allion();</p><p> c.startEngine();</p><p> c.turnoffGPS();</p><p> }</p><p>}</p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="DJvodka, post: 16463230, member: 186185"] උබ ඕක තේරුම් අරන් තියෙන්නෙ වැරදියට. [COLOR="Red"]Rectangle rec = new Rectangle(){};[/COLOR] මේ කරල තියෙන්නෙ anonymous inner class එකක් හදල ඒකෙන් අලුත් object එකක් හදල. පහල code එක බලල idea එකක් ගන්න. [CODE] abstract class Car{ abstract protected void startEngine(); //Different Cars have their own ways of starting the engine protected void turnoffGPS(){ System.out.println("Shutting off GPS"); } } class BMW extends Car{ protected void startEngine(){ System.out.println("Starting by voice recognition"); } } class Allion extends Car { protected void startEngine(){ System.out.println("Something wrong... :P"); } } class Test { public static void main(String args[]){ Car c = new BMW(); c.startEngine(); c.turnoffGPS(); c = new Allion(); c.startEngine(); c.turnoffGPS(); } } [/CODE] [/QUOTE]
Insert quotes…
Verification
Hath warak paha keeyada? (hatha wadikireema paha)
Post reply
Top
Bottom