Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question.

Comments in 'Plugin Development' started by xFlare, Feb 22, 2015.

  1. xFlare
    Offline

    xFlare Active Member Plugin Developer

    Joined:
    Sep 28, 2014
    Posts:
    199
    Plugins:
    1
    Minecraft User:
    xFlare
    I been wondering this since day one, what does it mean when there is "public" in front of a variable? I was never able to figure this out.
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
  3. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,325
    Plugins:
    11
    Minecraft User:
    PEMapModder
    To be more clear, making a variable/function private makes it inaccessible from another class. Making it protected makes it only accessible to that class and its subclasses. Making it public makes it accessible to any contexts.

    However, actually everyone can access them with a ReflectionProperty and ReflectionMethod although it is a bad practice. Anyway, for people with an IDE, making things they don't want to or don't need to see not showing up.
    xFlare likes this.

Share This Page

Advertisement