February 24, 201510 yr Because I decided that's where that inheritance branch should end There's no need for it to been extendable. Making a class final really just makes it unextendable ^^ And there's no need for it not to be? I could think of plenty of methods/properties to add, making a class final should only be done when it's absolutely critical that nothing be overriden/extended for the functionality of the class to stay intact (which isn't the case here).
February 24, 201510 yr Author And there's no need for it not to be? I could think of plenty of methods/properties to add, making a class final should only be done when it's absolutely critical that nothing be overriden/extended for the functionality of the class to stay intact (which isn't the case here). What kind of methods/properties would justify an extended class instead of just adding them to this one? I make my classes immutable and final by default, only making them mutable / extendable when it's absolutely necessary.
February 24, 201510 yr And there's no need for it not to be? I could think of plenty of methods/properties to add, making a class final should only be done when it's absolutely critical that nothing be overriden/extended for the functionality of the class to stay intact (which isn't the case here). he didn't make all the methods final so we can still override only the table generation cant be overriden because it's private RSExperienceTable table = new RSExperienceTable() { public int getXp(int level) { return 1337; } } Edited February 24, 201510 yr by VladBots
February 26, 201510 yr Administrator Might be better 'cpu-wise' to use a static table. Since CPU is more precious then the few bytes the table would use. I wouldn't worry about that CPU usage when it's calculated once and stored. It's not even that many calculations in the grand scheme of things anyways.
March 6, 201510 yr static final and not final static please, it's the prefered order Edited March 6, 201510 yr by VladBots
March 6, 201510 yr Author static final and not final static please, it's the prefered order Fixed lel, that looked gross.
Create an account or sign in to comment