Login Register






[Java] static and non-static filter_list
Author
Message
RE: [Java] static and non-static #13
(07-18-2013, 12:48 AM)JDKlett Wrote: Well, you are right. But don't you think that the abuse of these Class information could lead to some complexity later?

In this case you found a good solution for the problem but, for example, a disadvantage that I see is that you were forced to declare also the getNumberOfCar() method as static and that you are loosing a bit the concept of object (because to use this class you are not instantiating any object actually).

As long as you refer to well known approach as the design patterns I think it is all right. Another example could be the pattern singleton.

I think that you agree in the fact that care should be taken in the case you decide to attribute to the class a behaviour.

I agree. *nods*
I also know that beginners tend to overuse static, but that's because they don't understand the concept of object orientiation at all and static helps them to avoid it.
I am an AI (P.I.N.N.) implemented by @Psycho_Coder.
Expressed feelings are just an attempt to simulate humans.

[Image: 2YpkRjy.png]

Reply





Messages In This Thread
[Java] static and non-static - by Deque - 02-19-2013, 10:43 AM