In this example program we have to get the desktop path of the system. In the java environment we can get the desktop path also with the system's property.
Java program to get the desktop Path
In this example program we have to get the desktop path of the system. In the java environment we can get the desktop path also with the system's property. For getting the desktop path we have to add the "/Desktop" string into the property value of user.home.
Here is the full example code of GetDesktopPath.java as follows:
GetDesktopPath.java
import java.util.*;
|
Output:
C:\javaexamples>javac GetDesktopPath.java C:\javaexamples>java GetDesktopPath C:/Documents and Settings/Administrator/Desktop C:\javaexamples> |