This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

incompatible types  RSS feed

 
sneha krishna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my class, at the line

for (String coveredTestCase : getCoveredQCTestCases()) {

I am getting this error

TestBase.java:122: error: incompatible types
for (String coveredTestCase : getCoveredQCTestCases()) {

required: String
found: Object

Please help me how to debug this error.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66142
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does getCoveredQCTestCases() return?
 
Aj Maven
Greenhorn
Posts: 22
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Method getCoveredQCTestCases() seems to return an object. Check its return type first. Anyways you can convert the object to string by calling toString(). But know what the method is returning first.
 
Rob Spoor
Sheriff
Posts: 21048
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not Object but something that's an Iterable<Object>, Iterable<?> or Iterable (raw type). That Iterable could be a Collection, List, Set, etc. My guess is that the method does not use generics yet.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!