Private variables!?

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
Bencratus
Posts: 51
Joined: Wed Jan 07, 2015 11:38 pm
Contact:

Private variables!?

Post by Bencratus »

Hello,

If I use in only one class e.g. int x = 0; better make private int x = 0; ? Or this doesn't matter?

Thanks,
Bencratus
Last edited by Bencratus on Sat Feb 21, 2015 8:26 pm, edited 1 time in total.
canislupus
Posts: 66
Joined: Tue Dec 24, 2013 1:30 am

Re: Private variables!?

Post by canislupus »

public modifier—the field is accessible from all classes.
private modifier—the field is accessible only within its own class.

http://docs.oracle.com/javase/tutorial/ ... ables.html
So you want a L2J Server? Check out my guide viewtopic.php?f=81&t=30556&p=182721#p182721
User avatar
Bencratus
Posts: 51
Joined: Wed Jan 07, 2015 11:38 pm
Contact:

Re: Private variables!?

Post by Bencratus »

canislupus wrote:public modifier—the field is accessible from all classes.
private modifier—the field is accessible only within its own class.

http://docs.oracle.com/javase/tutorial/ ... ables.html
Seems you didn't read everything or you don't understand. I don't even talked about public variable, but you posted what you found on google.
Nevermind :D
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: Private variables!?

Post by Zoey76 »

How is this relevant to High Five support?

Our standards say that we should use the smallest scope for the variable.

So private is better than default (without any keyword).
Powered by Eclipse 4.30 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
User avatar
Bencratus
Posts: 51
Joined: Wed Jan 07, 2015 11:38 pm
Contact:

Re: Private variables!?

Post by Bencratus »

Zoey76 wrote:How is this relevant to High Five support?

Our standards say that we should use the smallest scope for the variable.

So private is better than default (without any keyword).
Sorry for wrong place...
Thanks, I will change now all to private :D
canislupus
Posts: 66
Joined: Tue Dec 24, 2013 1:30 am

Re: Private variables!?

Post by canislupus »

Hi,

Why isn't it relevant? public would be the opposite of private am i right?
Bencratus wrote:
canislupus wrote:public modifier—the field is accessible from all classes.
private modifier—the field is accessible only within its own class.

http://docs.oracle.com/javase/tutorial/ ... ables.html
Seems you didn't read everything or you don't understand. I don't even talked about public variable, but you posted what you found on google.
Nevermind :D
Hey ! The intention is what truly matters! :D
So you want a L2J Server? Check out my guide viewtopic.php?f=81&t=30556&p=182721#p182721
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7005
Joined: Tue Aug 11, 2009 3:36 am

Re: Private variables!?

Post by Zoey76 »

canislupus wrote:Why isn't it relevant?
It's not relevant to High Five support, is a general coding question.
Powered by Eclipse 4.30 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
canislupus
Posts: 66
Joined: Tue Dec 24, 2013 1:30 am

Re: Private variables!?

Post by canislupus »

Oh i meant about my reply, since he didn't like it.

If it doesn't belong to the section then you must be right
So you want a L2J Server? Check out my guide viewtopic.php?f=81&t=30556&p=182721#p182721
Post Reply