Re: Implementation Inheritance
<tonyd62246@aol.com> wrote in message
news:1147615614.231173.267430@j55g2000cwa.googlegroups.com...
How can this implementaion inheritance be linked to run.
public class bird
{
protected static int referenceCount = 0;
public bird() { referenceCount++; }
protected void fly() { /* Flap wings, etc. */ }
static int getRefCount() { return referenceCount;}
public void main(String[] args)
{
// TODO code application logic here
}
}
class nightingale extends bird
{
nightingale()
{ referenceCount++; }
public void main( String[] args)
{
System.out.print("Before: " + referenceCount);
nightingale florence = new nightingale();
System.out.println(" After: " + referenceCount);
florence.fly();
}
}
"public static void main(String argv[])" method not found in
nightingale}nightingale failed.
Like your output says, you need a static main method. This is the only
permissable entry point in to a program.
And please use uppercase to start class names. It is convention that is
more or less written in stone and convention is good.
--
Mike W