Mega Code Archive
Categories
/
Java Tutorial
/
Development
Get Name of User Currently Logged In to the Computer
public class Main { public static void main(String[] args) { String currentUser = System.getProperty("user.name"); System.out.println(currentUser); } }