[java programming] Creating objects of class vs. superclass

2009-04-02 Thread hec-ubuntu
Oh, I forgot to remove the abstract keyword in FurryAnimal. My bad =) --~--~-~--~~~---~--~~ To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from this group, send email to javaprogrammingwithpassion-unsubscr...@googl

[java programming] Creating objects of class vs. superclass

2009-04-02 Thread hec-ubuntu
Maashu, Yes. It would still inherit the talk() method. Overriding that method (making your own implementation) would do a different thing. public abstract class FurryAnimal{ @Override public void run() { // TODO Auto-generated method stub } @Ov

[java programming] Creating objects of class vs. superclass

2009-04-02 Thread hec-ubuntu
Maashu, If there are no method declarations under the Dog class, then it would implement it's parent's method ( Animal's talk() method). --~--~-~--~~~---~--~~ To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from thi

[java programming] Creating objects of class vs. superclass

2009-04-01 Thread hec-ubuntu
Let's say you have three Animals, a dog, a cat and man. public class Animal{ void talk(){ System.out.println("I'm talking"); } void walk(){ System.out.println("I'm walking"); } } public class Man extends Animal{} public class Dog extends Animal{} public class Cat extends Animal{}

[java programming] Creating objects of class vs. superclass

2009-04-01 Thread maa...@gmail.com
Hi All, I apologize if this question has been answered, but I've read all the lessons and supporting material (up to "inner class," at least) and I've spoken to a colleague who has taken a similar intro to Java class, but I still can't figure this out. My question is this: I know that it's possi