Originally posted by Aji Prasetyo:
So, I get the feeling that the more instantiated object the more workload for the garbage colector. Is it means that the program's performance is lessen?
[OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Originally posted by vijay vv:
...
2) Static methods / variables are against OO principles. It is another way of implementing global access in the procedural languages.
This is from my experience. Please correct me if I am wrong.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
One more thing, in practice for-instance I have a class named Master. Inside Master I have an inner class called InnerMaster. The innerMaster need a variable mVariable from Master. In this case should I make the variable static or not?
Originally posted by Mladen Girazovski:
Of course it has to be static, or you wn't be able to access it.
Originally posted by Mladen Girazovski:
static as such is not bad and certainly not "not ObjectOriented", it just depends on the usage, nothing else.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Originally posted by Mladen Girazovski:
Of course it has to be static, or you wn't be able to access it.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Sorry, that's just plain wrong. One can access outer class instance variables from a non-static inner class.
In the original poster's class, the inner class is non-static, so it can access static and instance variables of the outer class.
I disagree here, too, but in this case it is a subjective opinion. An application with a lot of static methods is not a good object-oriented design - it's procedural. Static methods prevent overriding and polymorphism, which are key to object-orientation.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |