Faculty of Engineering and Mathematical Sciences 
Not logged in (login)

help2200


This forum is provided to promote discussion amongst students enrolled in Data Structures and Algorithms (CITS2200).
 
Options:
RSS cloud
Jump to:

Lab 3 Method name not working (override?)

4 of 251 articles shown, currently no other people reading this forum.
photo
From: ANONYMOUS
Date: Mon 23rd Mar, 11:20am
Actions: 
        Login-to-reply
For my pushleft and pushright methods I have "public void pushLeft(Object c) throws 
Overflow {" but I'm getting a name clash error (Name clash: The method 
pushLeft(Object) of type DequeCyclic has the same erasure as pushLeft(E) of type 
Deque<E> but does not override it). I've tried putting           before the method 
but that doesn't work. What can I do to fix this?

Lab 3 Method name not working (override?)

photo
From: ANONYMOUS  O.P.
Date: Mon 23rd Mar, 12:01pm
Actions: 
        Login-to-reply
I also see that the interface uses element E, I'm not really sure how to use this with 
objects?

Lab 3 Method name not working (override?)

photo
From: Kimberley H.
Date: Mon 23rd Mar, 9:03pm
Actions: 
        Login-to-reply
I'm also stuck on how to use E rather then objects. Some guidance on how to use it would be great.

Lab 3 Method name not working (override?)

photo
From: Michael C.
Date: Wed 25th Mar, 8:54am
Actions: 
        Login-to-reply
The <E> part is simply meant to be replaced with what you want to use in the Deque. For example, if you 
wanted strings, you would implement it as Deque<String> when creating the class
This Page


Program written by: [email protected]
Feedback welcome
Last modified:  8:27am May 24 2020