This post how we get our system information in java. we can get our system information like OS Version, User name etc. by using java.util.Properties package.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | package com.kodemaker; import java.util.Properties; import java.util.Set; public class SystemProperties { public static void main(String[] args) { Properties properties = System.getProperties(); Set<Object> keys = properties.keySet(); for(Object key : keys){ System.out.println(key + ": " + properties.get(key)); } } } |
Guys, If your like this post please share it.
No comments:
Post a Comment