You are on page 1of 13

Lecturer:

Mahendra Data, S.Kom

Hi, I am JAVA
Java technology is both a programming language and a platform. Java programming language is a high-level language Java program can run in many platform.
How???

Hi, I am Duke, the JAVA mascot

How Java Work?

All source code is written in plain text files ending with the .java extension That source code then compiled into .class files

How Java Work?

A .class file does not contain code that is native to your processor. It contains bytecodes (the machine language of the Java Virtual Machine) instead Java launcher tool runs your application with an instance of the Java VM

How Java Work?


Java VM is available on many different operating systems. That is why a single .class files or java application can is capable of running on multiple platforms.

The Java Platform


A platform is the hardware or software environment in which a program runs. The Java platform has two components:
The Java Virtual Machine The Java Application Programming Interface (API)

Creating Your First Application


Make sure you have:
The Java SE Development Kit (JDK) A text editor (notepad, VIM) or an IDE (Eclipse, Nebeans)

Then read the instruction in http://download.oracle.com/javase/tutorial/g etStarted/cupojava/index.html

This is your home work!


Studi Java basic languages.
You can read the tutorial in http://download.oracle.com/javase/tutorial/java/ nutsandbolts/index.html

Create a Java program that count the characters from the standart input.

Don't worry, I'll give you some clues


The output should be like this:

This is some code snippet


import java.io.*; class CharCounter { public static void main(String[] Args) throws java.lang.Exception {

BufferedReader inputReader = new BufferedReader (new InputStreamReader (System.in)); System.out.print("Input a text : "); String inputText = inputReader.readLine(); System.out.println("Your text : " + inputText);
... } }

Example
You can download those example and code snippet at http://dataq.lecture.ub.ac.id/files/2011/09/C harCounter.zip

See you next time

Bibliography
http://download.oracle.com/javase/tutorial/

You might also like