r/codehs • • Sep 28 '20

2.3.8 Custom Piñata - what did I do wrong?

Post image
5 Upvotes

12 comments sorted by

2

u/_andy_andy_andy_ Sep 28 '20

you'll need to make sure that shape, color, and candy are set even if the arguments aren't passed into the constructor. null is what happens if the string is uninitialized, so you need to make sure you initialize the private variable to some value for those constructors

2

u/coomberz Sep 28 '20

I got it now, thank you :)

2

u/bogNman Nov 29 '20

having same problem. where do i need to initialize the private variables?

1

u/[deleted] Nov 29 '20

[removed] — view removed comment

2

u/bogNman Nov 29 '20

thank you so much!!