Minggu, April 03, 2011 di 07.54 |  
Pemrograman JAVA
Instruksi Input
Instruksi Pemilihan dua alternatif
If … else …
Instruksi Pemilihan multi alternatif
Switch( )
Instruksi Perulangan
For
While
Do/while

metode input string

DataInputStream data = new DataInputStream(System.in);
try {
.
.
Variable string =data.readln()
.
.
}catch (Exception e) {}
instruksi lanjut


Contoh: Untuk menampilkan sebuah nama
import java.lang.*;
import java.io.*;
class input {
public static void main(String[] args) {
String input=" ";
DataInputStream in = new DataInputStream(System.in);

try {
System.out.print("Masukkan Nama Anda : ");
input = in.readLine();
}
catch (Exception e) {}
System.out.println("Nama Saya Adalah " + input);
}
}
Diposting oleh Unknown

0 komentar:

Visit the Site
MARVEL and SPIDER-MAN: TM & 2010 Marvel Characters, Inc. Motion Picture © 2010 Columbia Pictures Industries, Inc. All Rights Reserved. 2010 Sony Pictures Digital Inc. All rights reserved. Provided By Free Website Templates | Freethemes4all.com
Free Website templatesFree Flash TemplatesFree joomla templatesSEO Web Design AgencyMusic Videos OnlineFree Wordpress Themes Templatesfreethemes4all.comFree Blog TemplatesLast NewsFree CMS TemplatesFree CSS TemplatesSoccer Videos OnlineFree Wordpress ThemesFree Web Templates