3:06 pm - Tuesday September 26, 2197

Tag Archives: stack

Vector Example Program for toString()

@author:candidjava.com @description:Vector Example Program for toString() */ import java.util.Vector; public class ToString { public static void main(String args[]) { Vector<Integer>vc=new Vector<Integer>(); vc.add(11); vc.add(22); vc.add(33); vc.add(44); System.out.println(vc); //convert...

Vector Example Program for copyInto(Object[] anArray)

// Vector Example Program for copyInto(Object[] anArray) /** @author: candidjava.com @description: This program copies the content of the vector into the Array */ import java.util.*; public class CopyInto { public static void...

Stack Example Program for addAll(Collection c)

// Stack Example Program for addAll(Collection c) /** * @author   candidjava.com * @description:Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's...

Stack Example Program for subList(int fromIndex,int toIndex)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of subList(int fromIndex, int toIndex). */ import java.io.*; import java.util.*; public class StackSublist { public static void main(String arg[])throws...

Stack Example Program for setElementAt(E obj,int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of SetElementAt() */ import java.io.*; import java.util.*; public class SetElementAt { public static void main(String arg[])throws Exception { Stack...

Stack Example Program for removeElementAt(int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of removeElementAt() */ import java.io.*; import java.util.*; public class RemoveElementAt { public static void main(String arg[])throws Exception { Stack...

Stack Example Program for removeAllElements()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of removeAllElements() */ import java.io.*; import java.util.*; public class RemoveAllElement { public static void main(String arg[]) throws...

Stack Example Program for lastIndexOf(Object o,int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of lastIndexOf(Obj o,int index) */ import java.io.*; import java.util.*; public class StackLastIndexOf { public static void main(String arg[])...

Stack Example Program for lastElement()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of lastElement(). */ import java.io.*; import java.util.*; public class StackLastElement { public static void main(String arg[]) throws Exception...

Stack Example Program for insertElementAt(E obj, int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of insertElementAt(). */ import java.io.*; import java.util.*; public class StackInsert { public static void main(String arg[]) throws Exception...

Stack Example Program for hashCode()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of hashCode() */ import java.io.*; import java.util.*; public class StackHashCode { public static void main(String arg[]) throws Exception...

Stack Example Program for firstElement()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of firstElement(). */ import java.io.*; import java.util.*; public class StackFirstElement { public static void main(String arg[]) throws...

Stack Example Program for equals(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of equals(Object o) */ import java.io.*; import java.util.*; public class StackEquals { public static void main(String arg[])throws Exception { Stack...

Stack Example Program for elementAt(int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of elementAt() . */ import java.io.*; import java.util.*; public class StackElementAt { public static void main(String arg[])throws Exception { Stack...

Stack Example Program for search(Object o)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of search () . */ import java.io.*; import java.util.*; public class Search { public static void main(String args[]) { Stack s=new Stack(); s.push(1); s.push(2); s.push(3); s.push(4); System.out.println(s); int...

Stack Example Program for push(E item)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of Push() . */ import java.io.*; import java.util.*; public class Push { public static void main(String args[]) { Stack s=new Stack(); s.push(1);...

Stack Example Program for pop()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of pop () . */ import java.io.*; import java.util.*; public class Pop { public static void main(String args[]) { Stack s=new Stack(); s.push(1); s.push(2); s.push(3); s.push(4); System.out.println(s); s.pop();...

Stack Example Program for peek()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of peek() . */ import java.io.*; import java.util.*; public class Peek { public static void main(String args[]) throws Exception { Stack s=new...

Stack Example Program for empty()

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of empty() . */ import java.io.*; import java.util.*; public class Empty { public static void main(String args[]) { Stack s=new Stack(); boolean...

Stack Example Program for listIterator(int index)

/** *@author :CandidJava.com *@descriptions : This program explain the function and use of listIterator(int index) */ import java.util.Stack; import java.util.ListIterator; public class ListIteratorIndex { public static void main(String...