• Post Reply Bookmark Topic Watch Topic
  • New Topic

type mismatch  RSS feed

 
mark cortez
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am work on an assignment, i needed to add a control loop and wanted to test it before I added it the existing code. I created a new java project and copy/pasted the class over. The new class (TestMain) gave me an error:
- Type mismatch: cannot convert from int to
Comparable
The original class only has a warning stating that comparable is a raw type and should be parametrized.
I am reading that ints can opt be cast as comparable, but I do not understand how it worked the first time.

Original Class that worked



Second class that had the errors
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please supply more details. I tried both your classes and they compiled without even a warning about raw types.
 
mark cortez
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to work for everyone in the world but me.
Could it be the build path? the one that does not work is set CDC-1.1/Foundation-1.1 and the working one the build path is LavaSE-1.7
Added the system library in the properties box . Now it works.
 
Campbell Ritchie
Marshal
Posts: 56570
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are those build paths? Do you mean Lava? I am pretty sure it would have worked in Java7.

I have just installed Java7 and it still worked. I think there may be a problem with those build paths. Please explain them. Also are you using a tool? you should tell us the full details if you want us to help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!