I have an error at this line of java program that methed getPrice in class book cannot be applied to given types. Required int | SoloLearn: Learn to code for FREE!

0

I have an error at this line of java program that methed getPrice in class book cannot be applied to given types. Required int

if(BOOK1.getPrice() > BOOK2.getPrice()) { BOOK1 . display(); } else { BOOK2 . display(); }

7/6/2020 1:32:54 AM

abdullah

5 Answers

New Answer

+1

Not enough information to answer. What are BOOK1 & BOOK2? How are they defined, what is getPrice() returning in your code. Share your code if you need help. Im future consider giving sometime to frame your question properly. Also go through this link https://www.sololearn.com/Discuss/333866/?ref=app

0

I first post the full code but there are not enough lines

0

Getprice return price.

0

Less lines is not an issue. All one need is enough information to resolve the issue, currently it is not enough information to answer.

0

abdullah just share the link with us. You do not need to copy the whole code inside this thread.