incompatible types!!
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: incompatible types!!

  1. #1
    Join Date
    Nov 2011
    Posts
    2

    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.

  2. #2
    Join Date
    Oct 2011
    Posts
    13

    Re: incompatible types!!

    What is your getCoveredQCTestCases() method retrun ?

  3. #3
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    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 code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center