Mengidentifikasi Karakter di Java

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

package identifikasikarakter;

/**
*
* @author Angga
*/
public class identifikasiKarakter {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
char karakter = ‘0’;
System.out.println(“Masukkan sebuah karakter :”);
try {
karakter = (char)System.in.read();
}
catch (Exception e){
}
if (karakter >= ‘0’ && karakter = ‘a’ && karakter = ‘A’ && karakter <= 'Z')
System.out.println("\""+karakter+"\""+" termasuk Huruf Besar");
else
System.out.println("\""+karakter+"\""+" termasuk Karakter Khusus/Operator");
System.out.println("By Mas ANGGA");

}

}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google

You are commenting using your Google account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s