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

2016/2/14

Confusing Homework Problem

GreenMan15 GreenMan15

2016/2/14

#
I am told to create an new scenario called Ball. I was given a sample screenshot of what my code is supposed to look like. In the ball world source code It says // new an instance of ball class here.
GreenMan15 GreenMan15

2016/2/14

#
I am wondering what the last statement means
danpost danpost

2016/2/14

#
GreenMan15 wrote...
I am wondering what the last statement means
It means any one of the following: * create a new ball object * instantiate an object of the Ball class * call the Ball class constructor with 'new Ball()' The constructor call returns the object created and can be put to use immediately or held in an Object reference variable and used one or more times later. Normally, when an Actor object (the Ball class is probably a class that extends the Actor class) is created, it is immediately placed into the world; but, this also can be done in two steps -- the creation of the ball; then the adding of the created ball into the world. (actually, it is always executed in two distinct steps; but, it does not have to be coded in two separate statements)
You need to login to post a reply.