[Question] Java Question

If something doesn't fit in any other forum then post it here.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Fogotend69
Posts: 28
Joined: Tue Mar 11, 2008 5:24 pm

[Question] Java Question

Post by Fogotend69 »

Hello Guys!

can tell me some things ... well in this code

Code: Select all

- private void giveAvailableSkills()+ public void giveAvailableSkills()
PS: If i change this... i will not have problem ... because giveAvailableSkills(); is called from much files ...

why changed from private to public ... so can anyone tell me diference.... and some times i see...
private static void name(); why this and not private void name();
User avatar
BiggBoss
L2j Veteran
L2j Veteran
Posts: 1104
Joined: Wed Apr 15, 2009 3:11 pm
Location: Spain

Re: [Question] Java Question

Post by BiggBoss »

there are many keywords which controls the member access to a class/field/method
you dont need to make the method visible to all if you are not gona use it out of the own class where is defined. So you can declare it private.
But if you need to use it in a external class, you can add other modifierds, as protected, public or no modifier, each one with a different access level

Refering to static, the static keyword is used to declare a field/method as common for all objects of that class.
Is logical that if you want to make a static reference, you need to declare it static
Image
Post Reply