1

Am facing an issue while trying to implement an example given over a website.

One of the methods in a class has a signature like this -

private void updateTable(JsArray prices) {....}

And am trying to invoke this method from another method as -

updateTable(JsonUtils.safeEval(response.getText()));

while doing this am seeing a compilation error as -

The method updateTable(JsArray) in the type StockWatcher is not applicable for the arguments (JavaScriptObject)

Though I have just used the exact code displayed in the website, am seeing this error. Not sure what needs to be done. Please help.

1 Answer 1

1

The problem has been fixed by making the following change -

updateTable((JsArray)JsonUtils.safeEval(response.getText()));

introduced a casting in the above statement.

Sign up to request clarification or add additional context in comments.

1 Comment

You can use generics instead of a cast: updateTable(JsonUtils.<JsArray<Whatever>>safeEval(response.getText()))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.