Chapter 1/Example1.java
public static void main(String args[])

    // "System" is a predefined class that provides access to the system
    // "out" is the output stream that is connected to the console

    {
        int VariableOne; // This declares a variable with the data type "int" which is an integer(Number)
        int VariableTwo; // This also declares another variable with the same data type

        VariableOne = 1000; // You can also assign a value before the main() program starts. The value is 1000.

        System.out.println("Hello world!"); // This is a simple string that will output "Hello world!"

        System.out.println("VariableOne contains:" + VariableOne); // As you can see a variable does not need quotation marks.

        System.out.println(VariableOne); // this will only output VariableOne value

        VariableTwo = VariableOne / 10; // Variable will contain the value of VariableOne that is divided by 10.

        System.out.println("VariableTwo contains:" + VariableTwo); // this will output a string and the VariableOne value.



    }
// String args[] declares a variable with the data type of a string
String args[] declares a variable with the data type of a string
String args [] declares a variable with the data type of a string
public static void main(String args[])
    {
        int VariableOne; 
        int VariableTwo; 
        VariableOne = 1000; 
        System.out.println("Hello world!"); 
        System.out.println("VariableOne contains:" + VariableOne); 
        System.out.println(VariableOne); 
        VariableTwo = VariableOne / 10; 
        System.out.println("VariableTwo contains:" + VariableTwo); 
    }
public static void main ( String args [ ] ) { int VariableOne ; int VariableTwo ; VariableOne = 1000 ; System . out . println ( "Hello world!" ) ; System . out . println ( "VariableOne contains:" + VariableOne ) ; System . out . println ( VariableOne ) ; VariableTwo = VariableOne / 10 ; System . out . println ( "VariableTwo contains:" + VariableTwo ) ; }
String args[] declares a variable with the data type of a string
String args [] declares a variable with the data type of a string
// "System" is a predefined class that provides access to the system // "out" is the output stream that is connected to the console // This declares a variable with the data type "int" which is an integer(Number) // This also declares another variable with the same data type // You can also assign a value before the main() program starts. The value is 1000. // This is a simple string that will output "Hello world!" // As you can see a variable does not need quotation marks. // this will only output VariableOne value // Variable will contain the value of VariableOne that is divided by 10. // this will output a string and the VariableOne value.