Home »
MCQs »
Java MCQs
Which Java method is used to detect the OS in which Java program is being run?
91. Which Java method is used to detect the OS in which Java program is being run?
- system.getOSdetails()
- system.get(os.name)
- system.getProperties("os.name")
- system.getProperties("os")
Answer: C) system.getProperties("os.name")
Explanation:
The Java method system.getProperties("os.name") is used to detect the OS in which Java program being run.