hayo gimana bikin program Nyusuki (kaya’ di Vending Machine) pake Java….

Contoh: Mesin harus ngembalikan uang 85 sen padahal ada koin 25-an, 10-an, 5-an, dan 1-an

gimana mesin bisa tahu harus ngembalikan 3 koin 25-an + 1 koin 10-an + 1 koin 5-an
Benernya ini khan logika biasa banget ya bagi kita manusia: biasanya ‘Algoritma’ cara mikir kita khan gini ya.. Continue reading


Arithmetic OPERATOR

Highest Precedence

First priority : the unary operators +, , ++, , !

e.g. total = – a;

Second : binary arithmetic operators *, / , %

e.g. total = a/b;

Third : binary arithmetic operators +,

e.g. total = a + b;

Continue reading

Three Main Components in my Simple Java Program

Let’s take a look at my simplest java Source Code “Hello Tony!”

At least I have to write 3 component:

1. Firstly, I must to define my CLASS Name

with sintax


class name {



in here I read this concept like: “this is a class named … and the content of the class inside {}Continue reading

COMMENTS in Java Source-Code

Comments are ignored by the compiler but are useful to other programmers. The Java programming language supports three kinds of comments:

// one line comment

/* comment */

/** comment */

First Program JAVA “Hello Tony!”

as common…for the first time, I tried to write my simplest source-code and just using NOTE-PAD as my Editor.

Let’s write Java source code displaying sentence “Hello Tony!” Continue reading

How to Set Up the PATH variable?

We can run the Java 2 SDK without setting the PATH variable, or you can optionally set it as a convenience.

Should I set the PATH variable?
Set the PATH variable if you want to be able to conveniently run the Java 2 SDK executables (javac.exe, java.exe, javadoc.exe, etc.) from any directory without having to type the full path of the command. If you don’t set the PATH variable, you need to specify the full path to the executable every time you run it, such as:

    C:> \j2sdk1.4.2_<version>\bin\javac

It’s useful to set the PATH permanently so it will persist after rebooting. Continue reading

install the ‘Java Platform’ on your PC!

Again..before you can run a Java program (Java byte-code or even Java source-code), you must set up the Java Platform (JVM+API) on your PC.

When I am writing this, the latest Java Platform(JVM + API) -Standard Edition for Windows is JDK 6 which can be download at here

How to Install the Java Platform (JDK) ?

Can be access at

Note: it is necessary to install the JDK Documentation also as your reference.