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-free) ආයුර්වේද ඇප් එකක් සොයා ගැනීමට නොහැකි වූ නිසා, මමම එකක් නිර්මාණය කළා
kitchen_discussions
Updated:
Yesterday at 2:34 AM
Ad icon
Iptv
musicking
Updated:
Sunday at 9:52 AM
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Jul 19, 2026
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Jul 18, 2026
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Java වැඩ්ඩො
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="BoraluGoda" data-source="post: 13251223" data-attributes="member: 332053"><p>මෙහෙමයි අක්කෙ අපිට සර් පොඩි පොඩි සාම්පල් කෝඩ් ටිකක් දුන්නා(LinkList Class, Link Class, QueueList Class). අපිට DATABASE නම් යූස් කරන්න ඔන නැ න කියුවා.</p><p></p><p>Link Class</p><p></p><p>[CODE]public class Link{</p><p> public double data;</p><p> public Link nextLink;</p><p></p><p> //Link constructor</p><p> public Link(double d) {</p><p> data = d;</p><p> }</p><p></p><p> //Print Link data</p><p> public void printLink() {</p><p> System.out.print("{" + data + "} ");</p><p> }</p><p>}[/CODE]</p><p></p><p></p><p>LinkList Class</p><p></p><p>[CODE]class LinkList {</p><p> private Link first;</p><p> private Link last;</p><p></p><p> public LinkList() {</p><p> first = null;</p><p> last = null;</p><p> }</p><p></p><p> public boolean isEmpty() {</p><p> return first == null;</p><p> }</p><p></p><p></p><p> public void insertlast(double d2) {</p><p> Link link = new Link(d2);</p><p> if(isEmpty()){</p><p> first = link;</p><p> }else{</p><p> last.nextLink = link;</p><p> }</p><p> last = link;</p><p> }</p><p></p><p> public double deleteFirst() {</p><p> double temp = first.data;</p><p> if(first.nextLink == null){</p><p> last = null;</p><p> }</p><p> first = first.nextLink;</p><p> return temp;</p><p> }</p><p></p><p> public void printList(){</p><p> Link currentLink = first;</p><p> System.out.print("List: ");</p><p> while(currentLink != null) {</p><p> currentLink.printLink();</p><p> currentLink = currentLink.nextLink;</p><p> }</p><p> System.out.println("");</p><p> }</p><p>} [/CODE]</p><p></p><p>QueueList Class</p><p></p><p>[CODE]public class QueueList{</p><p> private LinkList theList;</p><p> </p><p></p><p> public QueueList(){</p><p> theList = new LinkList(); </p><p> }</p><p></p><p> public boolean isEmpty(){</p><p> return theList.isEmpty();</p><p> }</p><p></p><p> public void enqueue(double d){</p><p> theList.insertlast(d);</p><p> }</p><p> </p><p> public double dequeue(){</p><p> return theList.deleteFirst();</p><p> }</p><p></p><p> public void displayQueue(){</p><p> System.out.println("Queue (Front ---> Rear): ");</p><p> theList.printList();</p><p> }</p><p>}[/CODE]</p><p></p><p><span style="font-size: 15px">අපි මෙ කෝඩින් කරෙ Text Documents වල සහ කම්පයිල් කරෙ Command Prompt එකේ.</span></p><p><span style="font-size: 15px">තරහ නැතුව මට Three Tire Architecture එකට මෙ (Net Beans) Program එක හදල දෙන්න පුලුවන්ද.</span></p><p><span style="font-size: 15px"><span style="color: DarkRed">ගොඩක් පින් සිද්ද වෙනවා</span>.</span></p></blockquote><p></p>
[QUOTE="BoraluGoda, post: 13251223, member: 332053"] මෙහෙමයි අක්කෙ අපිට සර් පොඩි පොඩි සාම්පල් කෝඩ් ටිකක් දුන්නා(LinkList Class, Link Class, QueueList Class). අපිට DATABASE නම් යූස් කරන්න ඔන නැ න කියුවා. Link Class [CODE]public class Link{ public double data; public Link nextLink; //Link constructor public Link(double d) { data = d; } //Print Link data public void printLink() { System.out.print("{" + data + "} "); } }[/CODE] LinkList Class [CODE]class LinkList { private Link first; private Link last; public LinkList() { first = null; last = null; } public boolean isEmpty() { return first == null; } public void insertlast(double d2) { Link link = new Link(d2); if(isEmpty()){ first = link; }else{ last.nextLink = link; } last = link; } public double deleteFirst() { double temp = first.data; if(first.nextLink == null){ last = null; } first = first.nextLink; return temp; } public void printList(){ Link currentLink = first; System.out.print("List: "); while(currentLink != null) { currentLink.printLink(); currentLink = currentLink.nextLink; } System.out.println(""); } } [/CODE] QueueList Class [CODE]public class QueueList{ private LinkList theList; public QueueList(){ theList = new LinkList(); } public boolean isEmpty(){ return theList.isEmpty(); } public void enqueue(double d){ theList.insertlast(d); } public double dequeue(){ return theList.deleteFirst(); } public void displayQueue(){ System.out.println("Queue (Front ---> Rear): "); theList.printList(); } }[/CODE] [SIZE="4"]අපි මෙ කෝඩින් කරෙ Text Documents වල සහ කම්පයිල් කරෙ Command Prompt එකේ. තරහ නැතුව මට Three Tire Architecture එකට මෙ (Net Beans) Program එක හදල දෙන්න පුලුවන්ද. [COLOR="DarkRed"]ගොඩක් පින් සිද්ද වෙනවා[/COLOR].[/SIZE] [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom