I am pretty new to coding and I am confused on how you make a constructor that takes only two arguments. When I compile I get the error: GradeAnalyzer.java:49: error: method getAverage in class GradeAnalyzer cannot be applied to given types myAnalyzer. Since the ZeroBalance class makes no use of an amount argument, your class should have a constructor that takes only two arguments and it should override the toString method so as not to mention any amount. Asking for help, clarification, or responding to other answers. I suspect you just want: throw new ItemNotFound (id) (Given that the id. What ends up happening in my code is that in the class usePackage(), when I input Package pack new Package() or InsuredPackage pack new InsuredPackage(), I end up getting an error'Constructor cannot be applied to given types, Required: String,double,String Found: No Argument. Run with -info or -debug option to get more log output. Try: Run with -stacktrace option to get the stack trace. Write a concrete class ZeroBalance that extends the abstract class Transaction, and whose adjustAccount method causes the Account's balance to be set to zero. Thanks for contributing an answer to Stack Overflow Please be sure to answer the question.Provide details and share your research But avoid. The ItemNotFound class only has one constructor: one that takes an int parameter: public ItemNotFound (int id) Youre trying to call that without any arguments: throw new ItemNotFound () Thats not going to work - you need to pass an argument for that parameter. Fork zorkyy commented on What went wrong: Execution failed for task ':compileJava'. I am trying to answer the following prompt:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |