10/31/2023 0 Comments Greenfoot intersects example![]() Which number corresponds to which direction? Write them down. Provide a parameter value and see what happens. ![]() setDirection method:int direction indicates method requires 1 integer parameter to run From Introduction to Programming with Greenfoot by Michael Kölling Used with permissionįrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.5 Invoke the setDirection(int direction) method.One or more parameters – additional information required to run.Empty – needs no additional information to run.Parentheses hold the parameter list – additional information to run.Can you create a situation in which the result of this method is not zero? (In other words: can you make your wombat eat some leaves?) Does it always return true? Or can you find situations in which it returns false?įrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.4 Using a newly created wombat, the getLeavesEaten() method will always return zero. boolean – true or false From Introduction to Programming with Greenfoot by Michael Kölling Used with permissionįrom Introduction to Programming with Greenfoot by Michael Kölling Used with permission Exercise 1.3 Invoke the canMove() method on your wombat.Any other word indicates information that is returned.void returns nothing – completes task and stops.Return type indicates what the method returns to us.Place two wombats in your world and make them face each other. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |