All right, I need some help from you for a Fresh Programming Greenfoot Scenario.
Devise a class that finds all the classes that implement interface A and creates an object of each class.
That Fresh Programming Weebly Website, Barely Interactable.
I made a new one here:
http://freshprogramming.enjin.com/
It's an enjin one, and I'll see to make it home.
Actually, I just realized that the Website has a Forum and Chat, but requires a new account.
Enjin websites, also needs a new account, but Enjin accounts can join any enjin forum.
Hey Guys, something different form your discussion. Can someone help me here?I have this:
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* Write a description of class MyDog here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class MyDog extends Dog
{
private String image = "dog.png";
private int energy = 100;
private boolean amSleepy = false;
private int countSteps;
/**
* Act - do whatever the MyDog wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
//All code relating to the player-controlled dog goes here
walkMyDog();
}
}
/**
* This dog gets sleepy when its energy hits 20 or lower.
*/
public boolean isSleepy(){
if ( energy <= 20 )
{
amSleepy = true;
}
else
{
amSleepy = false;
}
return amSleepy;
}
Now every time I try to compile this, I have this error displayed: class, interface, or enum expected with emphasis in the source code highlighting this whole method in yellow: ' public boolean isSleepy() ' , also marking a redline before |boolean. What am I doing wrong, please tell me?
2011/8/19
2011/8/19
2011/8/19
2011/8/19
2011/8/20
2011/11/29
2011/11/29
2011/11/30
2012/8/18
2012/8/23
2012/8/23
2012/8/26
2013/1/28