Add the following statement at the top of the code
import java.io.BufferedReader;
java.io.InputStreamReader import;
import java.io.IOException;
import java.io.*;
Numbers input class
{
public static void main (String [] args) throws IOException
{
Step 1. Declaration of Variable Input / output
String temp;
int number;
Step 2. Stat.Input connect with keyboard
InputStreamReader isr = new InputStreamReader (System.in);
BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
Or
InputStreamReader isr = new InputStreamReader (System.in);
BufferedReader bil = new BufferedReader (isr);
Or
BufferedReader bil = new BufferedReader (new InputStreamReader (System.in));
Step 3.Input Data
System.out.print ("Enter an integer:");
Step 4. Translating the input variables
/ * consider what data will be inputkan, is of type char, string or numeric * /
/ * note also that the data on double-inputkan numeric or integer type * /
temp = bil.readLine ();
number = Integer.parseInt (temp);
Step 5. output data
System.out.println ("Numbers are entered" + "is" + number);
}
}
import java.io.BufferedReader;
java.io.InputStreamReader import;
import java.io.IOException;
import java.io.*;
Numbers input class
{
public static void main (String [] args) throws IOException
{
Step 1. Declaration of Variable Input / output
String temp;
int number;
Step 2. Stat.Input connect with keyboard
InputStreamReader isr = new InputStreamReader (System.in);
BufferedReader br = new BufferedReader (new InputStreamReader (System.in));
Or
InputStreamReader isr = new InputStreamReader (System.in);
BufferedReader bil = new BufferedReader (isr);
Or
BufferedReader bil = new BufferedReader (new InputStreamReader (System.in));
Step 3.Input Data
System.out.print ("Enter an integer:");
Step 4. Translating the input variables
/ * consider what data will be inputkan, is of type char, string or numeric * /
/ * note also that the data on double-inputkan numeric or integer type * /
temp = bil.readLine ();
number = Integer.parseInt (temp);
Step 5. output data
System.out.println ("Numbers are entered" + "is" + number);
}
}
source : STMIK AMIKOM YOGYAKARTA
0 komentar
Posting Komentar