Contoh Penggunaan BufferedReader

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package biodata;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 *
 * @author DOA
 */
public class hitBuffer {
    public static void main(String[] args) throws IOException {
       
     BufferedReader a= new BufferedReader(new InputStreamReader(System.in));
    
        System.out.println("Masukkan Angka pertama? ");
        String angka=a.readLine();
        int angka1=Integer.parseInt(angka);
       
         System.out.println("Masukkan Angka kedua? ");
        String angka2=a.readLine();
        int angka11=Integer.parseInt(angka2);
       
       
        int hitung =angka1+angka11;
       
        System.out.println("Hasil = " +hitung);
       
       
       
    }
   
   
}
Contoh Penggunaan BufferedReader Rating: 4.5 Diposkan Oleh: Adhy

No comments:

Post a Comment