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
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Today at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Sunday at 3:05 AM
Power Lifting Lever Belt
SkullVamp
Updated:
Jun 13, 2026
Ad icon
port.lk Domain for sale
Lankan-Tech
Updated:
Jun 13, 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
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom