"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
--- Martin Fowler
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Both. If you have an array of Foos you can only put Foos into it. If you try, it is likely the compiler will notice and not let you. If you manage to sneak it past the compiler, you will suffer an Exception at runtime.matt leifi wrote:. . . all one type of object. Is it like that because that is a functional restriction, or is it good practice to not mix types in one array?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
matt leifi wrote:The idea of making a salesman class didn't occur to me since the instructor only specified that I have only a class for the parent "account" class and 3 child classes that extend the parent class (paperAccount, serviceAccount, suppliesAccount).
the instructor only specified that I have only a class for the parent "account" class and 3 child classes that extend the parent class (paperAccount, serviceAccount, suppliesAccount).
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Don't get me started about those stupid light bulbs. |