Java Programming

liamnic2

Super Star
Anyone know any Java programming starter packs I can get for free and a tutorial ?

I got Navicoder IDE but I think thats for more experianced users who already have files.
 

Frenchy

Prolific Poster
Anyone know any Java programming starter packs I can get for free and a tutorial ?

I got Navicoder IDE but I think thats for more experianced users who already have files.

I recommend starting with BlueJ, itll give you a good understanding of objects and the language in general. Use their IDE too. Then move on to using Eclipse of NetBeans as your main IDE. (Tehyre the two id recommend anyway)
 

liamnic2

Super Star
I am dowloadng BlueJ now thanks. What is an IDE extactly ? Is it like the main engine or something that the software runs on?
 

Frenchy

Prolific Poster
IDE stands for Integrated Development Environment. Its only a developers tool which allows code to be written much more easily and efficiently. IDE's often have tools such as autocomplete, error detection, debuggers, some even have things like UI builders as well as a multitude of other tools.

Java does not require an IDE to run. The way Java works (which is a bit different to other languages although kinda similar to C# and its CLI) is that you write .java files, these java files are written in a language that we understand, for example

int a = 5;
int b = 8;
if (a < b ) {
System.out.println("A is less than b");
} else {
System.out.println("A is not less than b");
}

This does what you would imagine.

Once you have written your code you use one of the tools found in the JDK (Java development kit) called javac, this is run off the command line (this is done for you by an IDE so you dont actually need to do it unless for example you are writing java in notepad). Javac compiles your code into byte code which the JVM can understand. This is the code you distribute to people to use on their computers.

The JVM is the Java Virtual Machine, it is essentially an interface to the computer itself. This is the same in other languages such as any CLI based language. The JVM understands byte code and converts it to machine code which each individual computer can understand. The reason we do this is because for example Linux has a different architecture than a Windows or a Mac and so the code the machine itself understands is somewhat different. If we as priogrammers had to understand akll the differences and code every program we make for all the specific differences we would have an extremely hard time doing so. The JVM takes care of this so we have a common interface into any platform.

As well as providing a common interface to the platform the JVM also performs many other tasks which Java developers come to rely on, for example Garbage Collection. When an object goes out of scope in a language such as C you have to make sure you deallocate memory, otherwise that memory is lost until your program terminates, this is whats called a memory leak, this can cause rapid build ups of wasted memory and is BAD. The JVM gets aropund this (although you can still in rare occasions get memory leaks in Java) by keeping a counter on the number of references an object has, if this reference count drops to 0 it is added to a pool of objects, when the JVM is next free it then runs the garbage collector which frees up all the memory from any items in this pool.

Anyway, the IDE is just an aid, it isn't a necessity.

Hope that helps.
 

liamnic2

Super Star
Search JDK on google and download the latest JDK http://www.oracle.com/technetwork/java/javase/downloads/jdk-7u3-download-1501626.html

This is the java development kit, it allows you to develop java by including tools such as javac which aloows you to compile java code (.java files) into byte code (.class files)

Ok thats great thx Frenchy. Im now just looking to download the "people" example file.
I noticed that Java coding isnt too different to visual basic.

int a = 5;
int b = 8;
if (a < b ) {
System.out.println("A is less than b");
} else {
System.out.println("A is not less than b");
}

For me thats just like visual basic.
 

Frenchy

Prolific Poster
Ok thats great thx Frenchy. Im now just looking to download the "people" example file.
I noticed that Java coding isnt too different to visual basic.



For me thats just like visual basic.

Its the same with many languages tbh, youll grasp many of the concepts easily from having learned other languages, however, you will have to learn specific ways in which certain languages do particular things. Simple examples would be things like switch case, in some languages strings are supported while in java until JRE 7 strings werent supported only ints.
 
Top