1. #1
    Unregistered

    How to implement push, pull stacks in Android?

    How do I implement push and pull stacks in Android. Give me proper explanation.

  2. #2
    soundtrack12 soundtrack12 is on a distinguished road
    Join Date
    Jun 2012
    Posts
    555

    Re: How to implement push, pull stacks in Android?

    To implement stack in Android you must import the some inbuilt classes having the required methods. You must import following
    Import the following classes and methods
    1) java.util.Vector,java.util.use
    2) Public constructors like Stack(). It constructs a stack having the default size of Vector class.
    3) Methods you can use are
    a)empty() with boolean as return data type which tells whether stack is empty or not.
    b)peek() which returns the element at the top of the stack without removing it.
    c)pop() which returns the element at the top of the stack and removes it.
    d) peek() which returns the element at the top of the stack without removing it.
    e) push() which pushes the on top of the stack.

    Methods Inherited
    a)Stack ()
    Constructs a stack with the default size of Vector.
    b)empty ()
    Returns whether the stack is empty or not.It returns true if the stack is empty, false when stack is full. It throws EmptyStackException if the stack is empty.

+ Reply to Thread

Similar Threads

  1. Replies: 3
    Last Post: 07-09-2012, 12:30 PM
  2. Resolving Pull and Push File Disable Problem on Android phone
    By Unregistered in forum Android Discussions
    Replies: 2
    Last Post: 25-05-2012, 01:03 PM