Method "XXX" with signature "XXX" is not applicable on this object

Source: Internet
Author: User

Method "XXX" with signature "XXX" is not applicable on this object

Running into a problem with message "method 'xx' with signature 'xx'
Is not applicable on this object ", still trying to figure it out.

Fixed.

In the original code, there are three classes and Class A extends Class C, Class B extends Class C.

There are two methods in another class.

Public void example1 (C)

{

Example2 (C );

}

Private void example2 (C)

{

}

Because in the example1 method, the parameter C is a instance of,
When callmethod example2, the method example2 with signature C is not
Applicable on this object.

The code after my fix:

Public void example1 (C)

{

If (C instances)

Example2 (a) C );

} Else if (C instances B)

{

Example3 (B) C );

}

// Changed the parameter from C to

Private void example2 ()

{

}

/// Added another method example3 with the parameter B

Private void example3 (B)

{

}

My website www.threes.cn

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.