` You can view and download the class JavaDemo.java
import java.lang.System
import java JavaDemo
System infos `
instance of the java.lang.System class
JavaDemo demo ` instance of the JavaDemo
class
demo.myVar = infos.getProperty("java.version")
print "Java version"
, demo.getVar()
demo.setVar(infos.getProperty("os.name") + " "
+ infos.getProperty("os.version"))
print "OS", demo.myVar
demo.exit(0)
| public class JavaDemo { public String myVar; // Assign a value to a variable public void setVar(String str) { myVar = str; } // Return the value of a variable public String getVar() { return myVar; } } |