Say I have like 50 different classes that extends "CustomEnchantment", is there any way to have a static getter in the abstract class that gets me one of the values of a specific class. Say I want max level of "Rage" then i'd do Rage.getMaxLevel() or something, in a static way. Problem is that getting an instance would mean i'd have to make 50+ instances 1 for each enchant. I want to just have a fix way to get a specific enchant's max level. I have tried to just include a "getMaxLevel()" and it returns it fine, but with that, i would need an instance of every single class that extends the abstract class, i'd rather have a static way of getting 1 specific class value. Some examples:
I have 3 classes extending Person. Person includes the variables age and name. In the class Josh, his name is set to "Josh" and age 17. In the class Jeff, his name is "Jeff" and age 20. In the class Jennica, name is "Jennica" and her age is 19. What I need is a method to return the age from a specific one of these classes at any time with only 1 method. So for example (This wont work) getAge(Jennica) gets Jennica's age, getAge(Josh) returns 17 for his age etc.. I need this to be used in a static or in a way where I can access it easily.