import java.util.*;
public class Proper{
public static void main(String args[])
{
Properties p= System.getProperties();
p.list(System.out);
String course=System.getProperty("ramu");
System.out.println("NOW USER
DEFINED PROPERTY IS STARTED");
if(course.equals("dayina@chirala"))
System.out.println(course);
else
System.out.println("UNKNOWN");
}
}
execution
D:\Threads>java
-Dramu=dayina@chirala Proper
-- listing properties --
PROPERTIENAME= VALUE
java.runtime.name=Java(TM) SE Runtime
Environment
sun.boot.library.path=C:\Program
Files\Java\jre1.8.0_31\bin
java.vm.version=25.31-b07
java.vm.vendor=Oracle Corporation
java.vendor.url=http://java.oracle.com/
path.separator=;
java.vm.name=Java HotSpot(TM) Client
VM
file.encoding.pkg=sun.io
ramu=dayina@chirala
NOW USER DEFINED PROPERTY IS STARTED
dayina@chirala
కామెంట్లు లేవు:
కామెంట్ను పోస్ట్ చేయండి