This site requires JavaScript, please enable it in your browser!
Greenfoot back
bubble96
bubble96 wrote ...

2021/2/19

how to create multiple parameters within a constructor

bubble96 bubble96

2021/2/19

#
for the constructor, create two (2) parameters. One parameter will be of type integer and the other will be of type String. The constructor’s code will check the value of the String parameter and assign an image, and type appropriately: a) If the String value of the second parameter is “happy”, assign the first image and speed set to two (5) and set type to “happy”. b) If the String value of the second parameter is “sad”, assign the second image and speed set to four (1) and set type to “sad”. c) If the String value of the second parameter is “angry”, assign the third image and speed set to one (9) and set type to “angry”. need help with this please
danpost danpost

2021/2/22

#
This appears to be an assignment. Maybe you should refer to the java tutorials for help on this, particularly the section on arguments.
You need to login to post a reply.