It's UWAweek 26 (mid-year break)

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 selected article
Showing 1 of 257 articles.
Currently 10 other people reading this forum.


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

Login to reply

👍?
helpful
10:52am Mon 20th May, Andrew G.

ANONYMOUS wrote:
> Hello, > > I have been struggling on this error for a couple days now: "Type mismatch: cannot convert from reduceIterator<T,R> to R", and I am not sure what I am doing wrong here. The structure I am using in my reduceIterator class is: > > public class reduceIterator<T, R> implements Iterator<R> { > // code > public reduceIterator(Iterator<T> it, R init, BiFunction<R, T, R> f) { > //code > } > @Ov*r*i*e* > public boolean hasNext() { > //code > } > @Ov*r*i*e* > public R next() { > // code > } > } > Any hints would be greatly appreciated. Thanks.
Please be more careful when posting code. In this case I believe there is no issue, as you have redacted large amounts of the code and what remains is not part of a possible solution. If this code had been correct, however, it would be more worrying. Remember that part of this project is the use of generics and class definitions, so just redacting the method bodies does not make code safe to share with other students.

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