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
V2ray VPN for Tunneling
hu KANNA
Updated:
Oct 22, 2026
FREE SEO Check & Google Maps Check for Sri Lankan Businesses | Web Design, Website Price Rs 14,900 |
LankaSolve
Updated:
Oct 20, 2026
ඕනම රටකට සෙට් වෙන CV එකක්
ErMurazor
Updated:
Oct 17, 2026
Hambantota
7 Acres Beachfront Land For Sell DownSouth , PerPerch Price 420 000
1024 Digital
Updated:
Oct 14, 2026
Baseus PI LITE INDOOR CAMERA
ErMurazor
Updated:
Oct 12, 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