View Single Post
Old 06-16-2007, 05:52 AM   #1 (permalink)
dingdong-man
 
Junior Techie

Join Date: May 2005

Posts: 66

dingdong-man

Default Java import statement

i'm trying to make a simple console application here that would be simplified by importing some class from Java.

import static java.lang.Character.isLowerCase;
import static java.lang.Character.isUpperCase;
import static java.lang.Character.isDigit;

public class LetterCheck{
public static void main(String[] args){
char symbol = 'A';
symbol = (char)(128*Math.random());

if (isUpperCase(symbol)){
System.out.println("It is CAPITAL letter ("+symbol+")");
}else {
if(isLowerCase(symbol)){
System.out.println("It is small letter ("+symbol+")");
}else {
System.out.println("It is NOT a letter ("+symbol+")");
}
}
}
}

i just wondering that if i remove the "static" in the import static, it won't work.. when do we put "static" in the import statement and when do not?
dingdong-man is offline