Java source code examples

Java source code samples. Java code examples.

Gets the logged in user name using java

* * * * * 1 votes

public class SystemExample {
	public static void main(String[] args) {
		String value = System.getProperty("user.name");

		System.out.println(value);
	}
}

Tags: java.lang

Discuss This Code