Java as one of programming language has just promised many amenities for junior programmer and also senior. this Tutorial will bring you to recognize farther this language through solution of simple scheme model concept and guide its use.
Is Java?
Java was programming language orients object developed by Sun Microsystems since the year 1991. This language developed with model is looking like language C++ and Smalltalk, but is designed that easier to be used and platform independent, that is can be implemented in various operating system types and computer architecture. This language also designed for programming in Internet causing is designed that be safe and portabel.
Platform Independent
Platform independent means program written in language Java to earn easily is removed between various operating system types and various computer architecture types. This aspect of vital importance to be able to reach purpose of Java as programming language Internet where a program will be implemented by various computer types with various operating system types. This character valids for level source code and binary code from program Java. Differs from language C and C++, all data types in language Java has consistent measure in all platform types. Source code program Java x'self not necessarily be altered at all if you compile wish tore- in other platform. Result from compile source code Java is not machine code or instruction of specific processor to certain machine, but in the form of bytecode which in the form of extension file . class. Bytecode earns your direct execution in every platform that by using Java Virtual Machine ( JVM) as interpreter to bytecode.
JVM x'self is an application run is above an operating system and translates bytecode program Java and executes it, so that in concept can be considered to be an interpreter. execution process of describable Java program as in Gambar 1. In this way, a program Java which has been compilation will be able to run in what particular platform, so long as there are JVM over there.
Kompiler and interpreter for program Java is in the form of Java Development Kit ( JDK) what produced by Sun Microsystems. this JDK can be download is free from situs java.sun.com. Interpreter for program Java x'self often also is called as Java Runtime or Java Virtual Machine. Interpreter Java, without its(the kompiler, called as Java Runtime Environment ( JRE) can be download also in the same situs. To develop program Java is required [by] JDK, while if only wish to implement bytecode enough Java with JRE only. But to execute applet ( a bytecode Java also) you usually no more require download JRE because browser which Java-enabled has owned JVM x'self.
Library
Besides kompiler and interpreter, language Java x'self has library which is big enough of which can water down you are in making an application swiftly. this Library has included for graphic, design user interface, kriptografi, network, voice, database, and others.
OO
Java is programming language orients object. Object-oriented programming clearly is technique to organize program and can be done with most all programming languages. But Java x'self implementation has various facilities that a programmer can optimal of object-oriented programming technique.
A few additional comparisons with language C and C++, Java many inheriting orientation concept of object from C++ but by eliminating complication aspects in language C++ without lessening its(the strength. This thing waters down newbie programmer to study Java but lessens facility of experienced programmer in mengutak-atic a program. At the opposite of amenity that is on the market Java, facility broadness library Java x'self makes a programmer to require time which is not shortened to be able to master usage of library-library.
Starts Java Programming
To make program Java, like has been mentioned before all, you requires JDK. installation process of JDK hardly easy and doesn't require certain knowledge. But to apply it your need to do some adjustment with your operating system. Generally you that need to do is enter path to directory JDK Anda to setting path at your operating system. Takes example directory JDK Anda is C:\jdk14 hence at Windows 98 you enough adding comand line SET PATH=C:\jdk14\bin at your autoexecbat file. For Windows NT/2000/XP Anda enough adding directory C:\jdk14\bin at variable path in System Environment. Its way: icon right click My Computer, select;chooses Properties. Then select;chooses tab Advanced. Then clicked button Environment Variables, variable searching path, then adds path directory JDK Anda into the variable. For Linux, adds comand line SET CLASSPATH=(direktori your jdk) to your profile file. To try JDK, types java comand and javac at shell prompt ( or DOS Command Prompt). If the comand have been recognized hence java program or javac will present sintaks usage. For amenity and various your addition facilities can apply Integrated Development Environment ( IDEA) for language Java like Visual Café from Symantec or JBuilder from Borland.
Stages;steps sequence which you must do to make a program Java simple is:
1. Makes source code program with any text editor. Remembers, the file extension must . java and case sensitive.
2. Compile source code by order of javac. For example: javac HelloWorldjava. If success, result of his(its is file bytecode ends . class.
3. Executes bytecode by order of java. Parameter from this comand is file name result of compilation without extension . class. Example: java HelloWorld.
Source Code
Following code for HelloWorldjava:
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Apa World News?");
}
}
And this an other example, that is simple applet to present text in applet. Calls this file so called HelloWorldAppletjava:
import java.awt.Graphics;
public class HelloWorldApplet extends java.applet.Applet
{
public void paint(Graphics g)
{
gdrawString("Apa Kabar Dunia?", 5, 25);
}
}
Clearly can be paid attention that second structure of program hardly looking like, and only differs in in execution context. Both this programs will be studied furthermore after we to study way of compile and executes the program.
Important to remember that language Java haves the character of case sensitive, so that you must pay attention to usage of uppercase and small. Besides writing of source code program is not must pay attention to certain form, so that you might possibly write down all lines source code in a line of you doesn't forget membubuhkan semicolon sign (;), or writes down every word in a line separate. But is suggested you to follow layout like at example of that your easy to read program and understood.
Compilation
After both files disave by the name of HelloWorldjava and HelloWorldAppletjava, we compile will second of the program by order:
prompt> javac HelloWorldjava
prompt> javac HelloWorldAppletjava
Need to be paid attention that active directory of you are the existing is directory place of you puts down the program files. You still your program compile can from directory differs from comand:
prompt> javac ( directory program)/namafilejava
After this comand completed, you will see that has been created two file . class, that is bytecode result of compilation source our code.
Sintaks Program
Now we will try studies elements in both source code.
In The Early Of Listing 2 we find import comand. At this early stage you should have knowledge that the statement only functioning waters down writing of method or in other programming language called as procedure or function. So You only need to write Graphics in the place of java.awt.Graphics, because we have imported java.awt.Graphics.
Then in each listing the

