Education Menu


Features Menu


Additional Menu


Now Online

We have 71 guests online



Follow US

Twitter You Tube Google Plus
Pinterest Facebook EduLanka Blog


Information Zone

eduLanka Sinhala

Welcome to eduLanka.LK, Largest online education web site in Sri Lanka & most popular educational web site among Sri Lankan students. EduLanka, Best nonprofit & educational website is provided large numbers of online lessons, education related course information, teachers information, E books, examination result alerts, goverment job alerts, tuition class information, career guide for school leavers and more resources related to education in Sri Lanka. Edulanka provides education related resources from primary education, O-Level & A-Level education, University & Postgraduate education and vocational training education.

EduLanka IDN Domains http://එඩියුලංකා.ලංකා http://எடியுலங்கா.இலங்கை

jobs Mathematics SLAS Exam Dharma Education Results


Inside Online School

Share Us

Home Page Information Technology Java Programing (ජාවා වැඩසටහන්කරණය)

Stack List - Java Example and Source Code
Wednesday, 23 March 2011 17:45

Stack List Java Example and Source Code

Java programing Language training and practices with Java Linked list Stack program source code. Link lists are main parts of Java programinig language and Java JDK 1.6 developing platform suitable for compiling and test those Linked list stack compleate programing source code. Java education online network of eduLanka web site provides  some list stack learning source codes

/*eduLanka Online education web site of Sri Lanka
-------- w w w . e d u L a n k a . l k ------------
java programs for University students - who follow courses - BIT - SLIIT and more
find more lessons in This e-mail address is being protected from spambots. You need JavaScript enabled to view it
this programs under GNU licence

import TerminalIO.*;

class ListNode{

Object element;
ListNode next;
public ListNode(Object ele){

public ListNode(Object ele,ListNode n){

class StackLt{
ListNode top;
ListNode newnode;
public StackLt(){

public boolean isEmpty(){
return top==null;

public void push(Object x){
newnode = new ListNode(x,top);

public Object pop(){
Object ele="Error";

System.out.println("Stack Error");}

return ele;

public void displayList(){
ListNode current=top;
System.out.println("List Empty");
System.out.println(current.element+" ");;

public class StackList{
public static void main(String arg[]){
int num;

String S=" ";
System.out.println("Enter Your Text");
for(int i=0;i<S.length(); i++){

StackLt mystk=new StackLt();
KeyboardReader input=new KeyboardReader();

for(int i=0;i<4; i++){
System.out.print("Enter Numbers : ");
int x=input.readInt();

System.out.println("\n After Inserting");

System.out.println("\n Deleted Element="+mystk.pop());
System.out.println("\n After deleting List Elements");


Download Java Code:


Add comment

Add comments relevant to this Article. මෙම ලිපියට අදාලව පමණක් අදහස් එකතු කරන්න.

Security code


Download Toolbar


Most Popular Articles

Latest Articles

Copyright © 2005 - 2016 (ඉස්කෝලේ) eduLanka Online Education School of Sri Lanka