- Access to environment through static functions and constants.
- Accessing standard output:
System.out.println("Hello World");
double d = 10;
System.out.println("Value of d :"+d+"cm.");
System.err.println("Error in "+this);
- Standard input
InputStream in used in applications:
(see section io for more information).
- Exiting the virtual machine:
System.exit(-1);
- Example: Getting the current directory.
System.out.println("Working Directory: "
+ System.getProperty("user.dir"));
|