I have an error in the Add and Remove test plese show me what is the erorr and h
ID: 3880043 • Letter: I
Question
I have an error in the Add and Remove test
plese show me what is the erorr and how can I fix it
please tybe the answer correctly
ConcetTicket - NetBeans IDE 8.2 File Edit View Navigate Source Refactor Run Debug Profile Teem Tools Window Help Search (Ct1+) cdefault config> Projects X Files Serices StartPageWallet java x xalletTest.java x Source History Source Packages Test 24 25 26 pubiic void testAdd) System.out-println ("add") wallet wallet new wallet () ; Test Packages ertTicket ctlnew ertTicket("phish", new (O9/29/2016 18.5 ket = new Concer cket 9/31/2016" @walefTest.java Lbrarnes 29 30 31 32 cidentifiers expected //wallet shuld be empty at tirst B: 1.8 (Default) assertEquals (0, wallet.getSize )) expected Test Lbraries B- Alt-Enter shows Unit 4.12-junit-4.12.jar Ham crest 1.3-hamorest-core-1.3.jar /add a ConcertTicket wallet.addicti) 34 35 36 37 38 39 40 41 42 //wallet shuld not be empty assertEqualsi, wallet.getsize)) WalletTest Navigator x Members /add a ConcertTicket wallet.add (ct2) E WaletTest WalletTestD O testAdd //allet shuld have 2 ConcertTicket.WaletTest Output ConcertTicket (test-singlc) X I> ant -f C:\Users \hal saiha\Docusents11NetBeansprojects\ConcertTiekeDjavae.1ne1udes-ConcertTicket/HalletTest, java o testresize0 O testToString0 -Del. int init Deleting:CsrshaisaihaDocusentsetBeansprojectsConcerieketbuiiabuiit-Jar properties deps-jar updating | property file: C:UsershalsainaDocumentsNetBeansprojectsConcertTieketteu11duilt-jar-properties Compiiing 1 source tile to CUsershalsaihaDocurentsnecBeanspzojectConcertTicketbuilantestielasses Users' halsaira Documents NetBeansprojectsConcertTicket test ConcertTicket MalletTest java:27: error : identifier > expected concertTieket et 1 ConcertTieket("phish", ("09/29/2016"), 18.5) = neu ne 118:2 INSExplanation / Answer
Please Do the following things :
1) You have forgot the "; " in the your statement, Copy and paste those statement.
ConcertTicket ct1 = new ConcertTicket("Phish", new ("09/29/2016"), 18.5); <------You forgot this.
ConcertTicket ct2 = new ConcertTicket("Beyonce", new ("09/31/2016"), 20); <----Here also.....
And You may have problem with you date in second object that is 09/31/2016 which have only 30 days in this september month, Please check.....
Becuse of this error you get the nullpointer exception.
If your problem still exist pls copy and paste your code or give me the link of the code where you uploaded.....
Thanks a lot, Please let me know if you have any problem...
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.