23 September 2010

Get the user name

public class PrintUserName
{
       public static void main(String args[]) {
              String username;
              username = System.getProperty("user.name");
              System.out.println("User Name : " + username);
       }
}

No comments:

Post a Comment