Could somebody please explain the difference? I've read alot on it and still do not fully understand.
Java EG (excuse any mistakes, I'm tired):
somewhere in main method, I'd have
Animal dog = new Animal(4,"Bob");
which creates object from:
static class Animal{
byte legs = 4;
String name = "";
Animal(){}
Animal(byte Legs,String Name){
legs = Legs;
name = Name;
}
}
This is what I've always done in OOP (in Java at least). What have I done exactly? Is it wrong? I know I've created an object of Animal and constructors blah but yes. Can somebody please explain?