Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: super() function how to make my program work without it

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default super() function how to make my program work without it

    Figured it out guess all I had to do was create an instance like this

    class Stack {	
    	Deque stack;
     
    	public Stack() {
    		stack = new Deque();
    	}
     
    	public void push(Object item) {
    		stack.insertOnFront(item);
    	}
     
    	public Object pop() {
    		Object deleted;
     
    		deleted = stack.deleteFromFront();
     
    		return deleted;
    	}
     
    	public boolean isEmpty() {
    		return stack.isEmpty();
    	}
     
    	public String toString() {
    		return stack.toString();
    	}
    }

    a lot simpler than I thought it would be

    --- Update ---

    I screwed this whole post up my bad can you guys just mark it as solved or delete it... so that it is like gone... anyway yeah thanks


  2. #2
    Junior Member
    Join Date
    Feb 2014
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: super() function how to make my program work without it

    stack = new Deque();
    I think it should be:
    stack = new ArrayDeque();
    or
    stack = new LinkedList();

Similar Threads

  1. Replies: 3
    Last Post: January 26th, 2014, 11:51 PM
  2. how to work wsimport for this WSDL i get errors and i cant make it work
    By pato.llaguno in forum What's Wrong With My Code?
    Replies: 6
    Last Post: January 24th, 2014, 05:27 PM
  3. unable to make thi work - program connectfour
    By sumoon in forum What's Wrong With My Code?
    Replies: 1
    Last Post: June 14th, 2013, 04:23 AM
  4. Function work in IE 8 or 9 but not in Chrome
    By GAMC in forum Other Programming Languages
    Replies: 2
    Last Post: August 3rd, 2012, 02:53 PM
  5. How To Make The Program Jump To The Next Function..
    By Kumarrrr in forum What's Wrong With My Code?
    Replies: 7
    Last Post: March 3rd, 2010, 12:33 AM