-
November 30th, 2011, 12:44 AM
#1
incompatible types!!
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.
-
November 30th, 2011, 06:02 AM
#2
Re: incompatible types!!
What is your getCoveredQCTestCases() method retrun ?
-
November 30th, 2011, 06:37 AM
#3
Re: incompatible types!!
What is your getCoveredQCTestCases() method retrun ?
It returns either an iterator that returns Objects or an arrays of Objects according to the error message sneha343 posted.
@sneha343
If the returned objects are definitely Strings then you should consider changing the return type of getCoveredQCTestCases(). Alternatively if you want the string representation of the objects then change the type of the for-each variable to Object and inside the code block call its toString() method to get the string representation.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|