twitterfacebook
Top 30 sites for freelancers
Every site you'll ever need! check it out →

Introduction to Java

Introduction to Java

What is Java?

Java
Java is a programming language derived from C and C++. It is a widely used programming language, used to make programs. Java and Javascript have nothing to do with each other. There are some similarities, just as all codes do. Java can be run on all operating systems, as a .jar. Java is a code used to make programs runable on all operating systems. There are some programs that can make your java program a web applet or even an android app.

Many games, such as Minecraft are coded in Java, as are Android apps. You can modify these games if you have a basic knowledge of Java. Its not recommended you do, if you are interested in becoming a serious programmer, as many games only have code such as turnLeft(2), which would make it turn left, which is coded in a different file. That would have nothing to do with actual Java coding, unless you are interested in game making.

Java needs to be downloaded to run and code it. A widely used compiler is Java Eclipse. You can find out how to both install and set up here: http://www.eclipse.org/downloads/moreinfo/java.php

A Java project is always made up of classes. A class is a file of code, which can be linked together to form an operation. An example would be Apple.java sending a piece of code to Orange.java asking for the name of the fruit. So the Orange.java would send back “Orange”.

Code:

public class Example{

public static void main(String args[]){

System.out.println(“Hello World!”);

}

}

What that would do, it would print on the system “Hello World!”. The first line declares the class. The second line makes the class have something display on the system. If it was missing, nothing would show on the System.

The third line prints a line saying Hello World!

Java is pretty hard to get the hang of, but when you do, you can make some amazing things!

You should try out the code as an example I gave above in Eclipse, which I also gave you a link to show you how to install and set up.

Good Resources:

docs.oracle.com/javase/tutorial/

www.tutorialspoint.com/java/index.htm

www.javabeginner.com/

Written by Oisin

Im a programmer, who enjoys HTML, CSS, Javascript, PHP, Java and Minecraft ;)

  • http://www.houndogstudios.com Alex

    Nice one Oisin 😉 I am trying to get my one soon 😛