Solved Is this right?

Discussion in 'Spigot Plugin Development' started by kadesa, Apr 18, 2017.

Thread Status:
Not open for further replies.
  1. Removed by owner
     
    #1 kadesa, Apr 18, 2017
    Last edited: Feb 16, 2018
  2. Um, I took a look at your code,
    what's the point of this?:
    Code (Text):
        public Boolean GetIsCraftable = IsCraftable();
        public Boolean GetIsUpgradable = IsUpgradable();
        public Boolean GetIsFoundInLoot = IsFoundInLoot();
    public Boolean GetIsBossDrop = IsBossDrop();
    Why not just make isCraftable, etc public methods?

    public variables are not loved in the OOP (Object-Oriented-Programming) Community, we like to use 'Encapsulation'. Read more about it here: https://www.tutorialspoint.com/java/java_encapsulation.htm
     
Thread Status:
Not open for further replies.