问题描述:

I have three different projects which has its java source files DBHandler (DBHandler.java) DataObject (DataObject.java) and LinkedIn (LinkedIn.java)

DBHandler has a method addLinkedInMessages(lpo) which takes the dataObjects' object.

and my LinkedIn calls the method addLinkedInMessages(lpo). Now I'm getting error

The method addLinkedInMessages(LinkedInPageObject) is undefined for

the type LinkedInDBHandler LinkedInPageLoader.java

However here is my code in the LinkedInDBHandler

public ArrayList<LinkedInAccountObject> getAllLinkedInUsersFromDatabase() {

ArrayList<LinkedInAccountObject> laoarray = new ArrayList<LinkedInAccountObject>();

LinkedInAccountObject lao = new LinkedInAccountObject();

return laoarray;

}

I added the dependent projects to other projects build path. But I'm unable to call the newly created methods. However I'm able to use the existing methods.

Please any one help me

网友答案:

You must add method addLinkedInMessages(LinkedInPageObject) which gets object of type LinkedInPageObject, to class LinkedInDBHandler.

网友答案:

What this exception means is you don't have a method called addLinkedInMessages accepting an attribute of type LinkedInPageObject in class LinkedInDBHandler.

So in your LinkedInDBHandler.java you must include:

public void addLinkedInMessages(LinkedInPageObject linkedInPageObject)
//     ^--- > or the return type you need
网友答案:

Thanks for your answers.

I actually had the method addLinkedInMessages(LinkedInPageObect) in the LinkedInDBHandler.java file.

The project was added and also build created and added the jar file into the project. Removed the jar resolved it since the jar was exported when these methods was not added.

Thanks once again for everyone posted answer here

相关阅读:
Top