3:13 pm - Friday December 16, 9098

Stack Example Program for capacity()

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**
*Stack Example Program for capacity()
* @author   candidjava.com
* @description:  Returns the capacity of the stack.
*/
import java.util.*;

public class Stackcapacity {
public static void main(String[] args) {
Stack a = new Stack();// creats stack object.
a.push("g");
a.push("f");// used for adding some elements in stack.
a.push("s");
a.push("c");
a.push("c");
System.out.println("Stack is:" + a);
System.out.println("capaciaty of the stack is " + a.capacity());// it
// display
// the
// capacity
// of
// the
// stack.
}
}

output:
capaciaty of the stack is 10

Filed in: Z-A All Java Codes

Comments are closed.