Download presentation
Presentation is loading. Please wait.
1
Defining Class Member Data/characteristics
B. Ramamurthy
2
Lets Review the “Class” Concept
Class Name Class data/characteristics Class behavior/methods Lets define our own Crab and Lobster class
3
Lets work with Greenfoot
Controlling actors from keyboard; counting; variables; World with pre-populated actors
4
Crab Class Crab Crab(); // constructor void lookForWorm();
void checkKeyPress() void switchImage() Void eatWorm() //data int numberOfWorms; GreenfootImage image1; GreenfootImage image2; //from its superclass or ancestor int x; int y;
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.