How to get OS name in Java?

System.getProperty("os.name") return the Operating System name in java.

Example

package com.pretech;
public class OSNameExample {
	public static void main(String[] args) {
		System.out.println(System.getProperty("os.name"));
	}
}

Output



Windows 7


No comments:

Post a Comment

Confusion Matrix + Precision/Recall (Super Simple, With Examples)

  Confusion Matrix + Precision/Recall (Super Simple, With Examples) 1) Binary Classification Setup Binary classification means the model p...

Featured Posts