nice man keep the work up!!
|
|
Description: Learning java, Where to download and adding variables.
Difficulty: 5/10 - Depends On Knowledge
Assumed Knowledge: What Java is, How to type.
Files/Classes Modified: HelloWorld.java and HelloWorld.class - What I'am using to teach you to start java.
Procedure
Step 1: Go to [Only registered and activated users can see links. ] and download latest java. 1.6.0_05-06 would be the best and this would help alot with this tutorial otherwise you can't do anything.
Step 2: Next you need a good text editor with a java compiler and a run java applet option. Notepad doesn't have this so you can go to [Only registered and activated users can see links. ] and download Textpad which most java programmers use or you could download Notepad++ from google, offical website or [Only registered and activated users can see links. ]
Step 3: Ok so you have your text editor, Java installed?
Next you need to set your enviromental variables which you can find on Krimzim's tutorial which is sticked on Rs2 Server > Tutorials 'Fixing common Java[C] error.
Step 4: Good you have your enviroment variables set now on to creating your first Java class file.
Open textpad or you're text editor (Notepad++ or Notepad) and type -
I will explain.Code:public class HelloWorld {
PUBLIC CLASS CLASSNAME { SHOULD ALWAYS BE DECLARED AT THE START OF A NEW CLASS FILE.
public - It can be accessed by other classes and can be ran by other classes with no permissions. public should always be lowercase.
class - The type of java file its trying to run. class should always be lowercase.
HelloWorld - The name of your class file you are editing this is very important otherwise its hard to read data and exchange data. The HelloWorld SHOULD ALWAYS be the exact same as the class file you are saving or you would get a complimation error.
{ - You've finished that line of code make sure its always the same bracket facing right when you've finished a line of code.
Next, When you've done that you begin with your main signiture.
Public - anything can access it.Code:public static void main (String[] args) {
Static - Theres one accorence with this in the program
Void - The main returns a value and it is passed on
Main - Is the main access point when the file begins.
(Strings[] args) - These are the parimeters that are accessed in the class file, Strings should have a capital letter because it loads differently and is a parimeter in the class file.
{ - The line of code has finished.
Next when that is done the next line of code after the bracket add
System - Loads from your system and the java system always has uppercase letter.Code:System.out.println("Hello world!"); {
out - Its outputting text from the java data source and not implanting (inputting) text into it so its in not out.
print - printing the line of code onto the compiler and the java applet
ln - starts the text on a new line, you can always remove the ln and just have print if you want
On the same line.Code:Hello world! press any key to continue...
("Hello World!") - The text you are using, should always have brackets and a " so it tells java to load whats inside the brackets and the " and what isn't.
; - Same as a bracket, I don't really know what it is but it finishes a line of code.
Next when you have done that add under the last bracket of the System.out.print
This tells the java compiler and run applet that the code has finished and it can write 'press any key to continue...'Code:{ {
So all together you should have -
Here is some more useful stuff.Code:public class HelloWorld { public static void main (String[] args) { System.out.println("Hello world!"); } }
Javac ignores /* to */ so when you release a program or a source people can see information about editing interfaces and such that the owner has left.Code:/* TEXT */
I fail at Java, But I'am just trying to help new coders out if you see any obvious errors point them out to me and I will fix them.
If you are starting java but get some errors head over to 'Error libary - PeeHPee' in Rs2 server - Help. It is sticked, All so you can read good tutorials like ones made by Ian... and The Guardian.
I'am learning java but doing bad in the progess when I actually learn good java I will try to develop better tutorials.
Credits: Me with some help from Sean Greseleys tutorials.
nice man keep the work up!!
This is a REAL Tutorial. Nice Job! ++ for all your Help in this Comunity.
Good Work![]()
THAT GUY HAS ONE CRACKLY VOICE.Credits: Me with some help from Sean Greseleys tutorials.But nice tutorial, good for new programmers.
| « add skillcape requirements to dodian/devolution | Creating Arrow (Frame 254) » |
| Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |