Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Dago Romer
1,769 PointsComparable and (Treet) obj in IDEA from Java Data Structure
I've been using IntelliJ IDEA to write all the code that we do here. Whenever I completed my code in Workspaces it compiled and ran like expected at the end of Java Data Structure video.
However when I pasted said code on IDEA it's giving me an error. 2 in fact
1) public class Treet implements Comparable{} gives an error that states that class Treet needs to be declared as abstract or I need to implement the abstract method compareTo(T). Which we did in this video.
2)inside the compareTo(Objects obj){} method I get an error when we cast Treet other = (Treet) obj;
it says "Inconvertible types; cannot cast java.util.Objects to com.teamtreehouse.Treet" which I'm guessing it's what's giving the error #1
Now this code works in workspaces but it won't compile in IDEA which obviously means that it's something specific to IDEA.
Does anyone know what the problem is? or why is IDEA giving out this error?
1 Answer
Seth Kroger
56,416 PointsObject, not Objects.