It's UWAweek 24 (1st semester, 2nd exam week)

help2005

This forum is provided to promote discussion amongst students enrolled in CITS2005 Object Oriented Programming.

Please consider offering answers and suggestions to help other students! And if you fix a problem by following a suggestion here, it would be great if other interested students could see a short "Great, fixed it!"  followup message.

How do I ask a good question?
Displaying the 4 articles in this topic
Showing 4 of 257 articles.
Currently no other people reading this forum.


 UWA week 21 (1st semester, week 12) ↓
SVG not supported

Login to reply

👍?
helpful
2:53pm Tue 21st May, Zhipeng W.

Just struggling to return an object with the DoubleEndedIterator interface implemented... Do I need to create a class implementing the interface first, then initiate an instance to return? Thank you.


SVG not supported

Login to reply

👍x1
helpful
3:14pm Tue 21st May, Andrew G.

"Zhipeng Wang" [email protected] wrote:

Just struggling to return an object with the DoubleEndedIterator interface implemented...

Do I need to create a class implementing the interface first, then initiate an instance to return? Thank you.

To satisfy the signature of the method you are trying to implement, you must return an object that implements DoubleEndedIterator. The only class in the provided code that implements this interface is RangeIterator, which will not behave as required. So you must find a way to construct an object that implements that interface with the right behaviour. There are several ways to do this. You mention one: Creating your own class.

You should not be encountering this for the first time in Task 5. Are you sure you understand your solutions to the previous tasks?


SVG not supported

Login to reply

👍?
helpful
3:14pm Tue 21st May, Zhipeng W.

In Task 5, I need to return an object having the interface of DoubleEndedIterator. But I can not initiate a interface, does that mean I need to create a class implementing the interface and then initiate the instance before returning ... Thank you!


SVG not supported

Login to reply

👍?
helpful
3:18pm Tue 21st May, Zhipeng W.

Thank you, I get it. I will go back and review previous tasks. Thanks!

The University of Western Australia

Computer Science and Software Engineering

CRICOS Code: 00126G
Written by [email protected]
Powered by history
Feedback always welcome - it makes our software better!
Last modified  5:07AM Sep 06 2023
Privacy policy