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
Video Content Creator
pramukag
Updated:
Today at 6:10 AM
Ad icon
QA Engineer Intern
pramukag
Updated:
Today at 6:07 AM
Ad icon
Sell your Land, House on idamata.lk for FREE
sajith.xp.pk
Updated:
Thursday at 9:03 AM
Handmade Character Soft Toys
anil1961
Updated:
Tuesday at 2:11 PM
Bodim.lk out now !
Manoj Suranga Bandara
Updated:
Jun 21, 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="tery123" data-source="post: 18418900" data-attributes="member: 343391"><p>[PHP]public class InnerClsDemo{ </p><p> public static void main(String args[]){ </p><p> Report rpt1=new Report("Sri Lanka","I love my country","End of the DOC"); </p><p> rpt1.print(); </p><p> } </p><p>} </p><p> </p><p>class Report { </p><p> String headerTxt; </p><p> String bodyTxt; </p><p> String footerTxt; </p><p> </p><p> public Report(String h,String b,String f){ </p><p> headerTxt=h; </p><p> bodyTxt=b; </p><p> footerTxt=f; </p><p> } </p><p> </p><p> public void print(){ </p><p> Header h=new Header(); </p><p> Body b=new Body(); </p><p> Footer f=new Footer(); </p><p> h.print(); </p><p> b.print(); </p><p> f.print(); </p><p> } </p><p> </p><p> //inner class 1: Header </p><p> class Header{ </p><p> public void print(){ </p><p> System.out.println("-----------------------------"); </p><p> System.out.println("------This is The Header-----"); </p><p> System.out.println("\t"+headerTxt); </p><p> System.out.println("-----------------------------"); </p><p> } </p><p> } </p><p> //inner class 2: Body </p><p> class Body{ </p><p> public void print(){ </p><p> System.out.println("- -"); </p><p> System.out.println("- -"); </p><p> System.out.println("------This is The Body-------"); </p><p> System.out.println("\t"+bodyTxt); </p><p> System.out.println("- -"); </p><p> } </p><p> } </p><p> //inner class 3: Footer </p><p> class Footer{ </p><p> public void print(){ </p><p> System.out.println("------This is The Footer-----"); </p><p> System.out.println("\t"+footerTxt); </p><p> System.out.println("-----------------------------"); </p><p> } </p><p> } </p><p>} [/PHP]</p><p></p><p>මෙන්න මේක පහදා දීපල්කෝ....<img src="/styles/default/xenforo/smilies/default/nerd.gif" class="smilie" loading="lazy" alt=":nerd:" title="Nerd :nerd:" data-shortname=":nerd:" /><img src="/styles/default/xenforo/smilies/default/nerd.gif" class="smilie" loading="lazy" alt=":nerd:" title="Nerd :nerd:" data-shortname=":nerd:" /><img src="/styles/default/xenforo/smilies/default/nerd.gif" class="smilie" loading="lazy" alt=":nerd:" title="Nerd :nerd:" data-shortname=":nerd:" /><img src="/styles/default/xenforo/smilies/default/nerd.gif" class="smilie" loading="lazy" alt=":nerd:" title="Nerd :nerd:" data-shortname=":nerd:" /></p></blockquote><p></p>
[QUOTE="tery123, post: 18418900, member: 343391"] [PHP]public class InnerClsDemo{ public static void main(String args[]){ Report rpt1=new Report("Sri Lanka","I love my country","End of the DOC"); rpt1.print(); } } class Report { String headerTxt; String bodyTxt; String footerTxt; public Report(String h,String b,String f){ headerTxt=h; bodyTxt=b; footerTxt=f; } public void print(){ Header h=new Header(); Body b=new Body(); Footer f=new Footer(); h.print(); b.print(); f.print(); } //inner class 1: Header class Header{ public void print(){ System.out.println("-----------------------------"); System.out.println("------This is The Header-----"); System.out.println("\t"+headerTxt); System.out.println("-----------------------------"); } } //inner class 2: Body class Body{ public void print(){ System.out.println("- -"); System.out.println("- -"); System.out.println("------This is The Body-------"); System.out.println("\t"+bodyTxt); System.out.println("- -"); } } //inner class 3: Footer class Footer{ public void print(){ System.out.println("------This is The Footer-----"); System.out.println("\t"+footerTxt); System.out.println("-----------------------------"); } } } [/PHP] මෙන්න මේක පහදා දීපල්කෝ....:nerd::nerd::nerd::nerd: [/QUOTE]
Insert quotes…
Verification
Asuwa dahayen wadi kalama keeyada?
Post reply
Top
Bottom