
help about learning java
Forum rules
READ NOW: L2j Forums Rules of Conduct
READ NOW: L2j Forums Rules of Conduct
-
- Posts: 122
- Joined: Tue Dec 22, 2009 6:54 pm
help about learning java
well guys i been here for some time and i learned how to read 79% the java and python but i havent a clue on how to start a script i wont some some links that i can learn the java that is used on l2 some guides i found where veryyy old and many thinks change intime so if u guys be kind and gimi some links i wana help building scripts and finishing unfinished scritps and expand them am a very promising person 

-
- Posts: 110
- Joined: Sun Oct 08, 2006 4:22 pm
Re: help about learning java
well you could start by looking at the .bat script used to startup the gameserver and the main method of the gameserver.java file...
Wasabi2k a.k.a. Meaglin.
Support my work:
Skills Documentation(wiki)
Custom NpcSkills Table( [4000] commited! )
Simple Bugfix
Conditions Cleanup
Community Board Cleanup
Support my work:
Skills Documentation(wiki)
Custom NpcSkills Table( [4000] commited! )
Simple Bugfix
Conditions Cleanup
Community Board Cleanup
-
- Posts: 122
- Joined: Tue Dec 22, 2009 6:54 pm
Re: help about learning java
yes but first i must know what the comands mean like Private static int /public final int//public etc. the 80% of time am guesing what they do so am not completely sure so if i see it i dont think i can understand anythink if i dont know what the symbols mean XD
-
- Posts: 915
- Joined: Thu Sep 03, 2009 6:36 pm
- Location: Israel
- Contact:
Re: help about learning java
well it's not that hard to comprehend 
here's a few pointers:
int = integer (numeric value)
float = a "Real" number, with also values after the decimal '.'
double = also a real number, but with a maximum of 2 values after the '.'
char = A (keyboard) character, or any other character for that matter, it's defined as 'a','1',';' etc...
String = An (sort of) array of characters, which allows to make complete words\sentences\text.
now about the whole 'public' thing - this defines who can "see" our variable:
- public - anyone can see it.
- private - only the specific class in which the variable is defined can see it.
- protected - only the specific class and the classes that extend it can see the variable.
there are also arrays, or collections of variables, which you will see as
int[] objectId - an array of integers
FastList<String> - a list of strings
and as for the final\static thing:
if there's a final before the variable definition - then this variable can(and must be) only be defined once - and this value will remain it's value 'forever'
static - means this variable can be used with a static reference, for example, in L2Character class you will find:
and throughout the code you can find static references to id, for example
L2Character.ZONE_PEACE is a static reference
anyways hope this helped

here's a few pointers:
int = integer (numeric value)
float = a "Real" number, with also values after the decimal '.'
double = also a real number, but with a maximum of 2 values after the '.'
char = A (keyboard) character, or any other character for that matter, it's defined as 'a','1',';' etc...
String = An (sort of) array of characters, which allows to make complete words\sentences\text.
now about the whole 'public' thing - this defines who can "see" our variable:
- public - anyone can see it.
- private - only the specific class in which the variable is defined can see it.
- protected - only the specific class and the classes that extend it can see the variable.
there are also arrays, or collections of variables, which you will see as
int[] objectId - an array of integers
FastList<String> - a list of strings
and as for the final\static thing:
if there's a final before the variable definition - then this variable can(and must be) only be defined once - and this value will remain it's value 'forever'
static - means this variable can be used with a static reference, for example, in L2Character class you will find:
Code: Select all
public static final byte ZONE_PEACE = 1;
Code: Select all
if (player.isInsideZone(L2Character.ZONE_PEACE)) return;
anyways hope this helped

- Stake
- Posts: 383
- Joined: Sun Mar 23, 2008 9:33 pm
- Location: Hungary
- Contact:
Re: help about learning java
Also, a static variable is shared in the memory, so when you call one class with a static variable, its variable will not reset to its basic value, but keep the previous modified value. It is useful with increment or decrement cycles too.
For example:
So, each time the class is used...
...the result will be 3 instead of 2.
For example:
Code: Select all
static class Ize{ private static int novel = 1; public Ize() { novel++; } public int getNovel() { return novel; }}
Code: Select all
Ize hm = new Ize();System.out.println(hm.getNovel());Ize hmm = new Ize();System.out.println(hmm.getNovel());


- BiggBoss
- L2j Veteran
- Posts: 1104
- Joined: Wed Apr 15, 2009 3:11 pm
- Location: Spain
Re: help about learning java
starting by
http://java.sun.com/docs/books/tutorial/
will take you into the Java basics.
Then the read book starts. Depending on what you wanna focusing more, here some useful-related to l2j
Concurrent Programming in Java - Doug Lea (Multi-Threading)
Java NIO - Ron Hitchens (New input/output)
Java Network Programming - Eliotte Rusty (morely dedicated to the socket protocol programming and server-side applications)
http://java.sun.com/docs/books/tutorial/
will take you into the Java basics.
Then the read book starts. Depending on what you wanna focusing more, here some useful-related to l2j
Concurrent Programming in Java - Doug Lea (Multi-Threading)
Java NIO - Ron Hitchens (New input/output)
Java Network Programming - Eliotte Rusty (morely dedicated to the socket protocol programming and server-side applications)
-
- Posts: 122
- Joined: Tue Dec 22, 2009 6:54 pm
Re: help about learning java
those are extreme guides thank guys XD but the think i wana focus more is more into ai's and instance's java like baium ai and crystal caverns etc. cuz l2j is missing a lot of retail ai's and instances and i allways wonted to do those they take time but they worth the work and one think i love about that is that if u know those 2 u can even try to complete the crystal caverns or even start deving on the gracia seeds instances that contains bothe instance functions (cuz its instance) and also whole ai's all this into an instance so i think it will be usefull to know these 2



- jurchiks
- Posts: 6769
- Joined: Sat Sep 19, 2009 4:16 pm
- Location: Eastern Europe
Re: help about learning java
what ever you want to do, books are your friends in this matter
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.