0% found this document useful (0 votes)
24 views

Mahendra Data, S.Kom: Lecturer

The document provides an introduction to Java, explaining that Java is both a programming language and platform that allows code to run on multiple operating systems through the use of a Java Virtual Machine. It then assigns as a homework assignment for students to create a Java program that counts the characters from standard input, and provides code snippets and examples to help with this task.

Uploaded by

dataq17
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Mahendra Data, S.Kom: Lecturer

The document provides an introduction to Java, explaining that Java is both a programming language and platform that allows code to run on multiple operating systems through the use of a Java Virtual Machine. It then assigns as a homework assignment for students to create a Java program that counts the characters from standard input, and provides code snippets and examples to help with this task.

Uploaded by

dataq17
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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