/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package newvariables;

/**
 *
 * @author Lee Leong
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        // example with String
        String street, city, state;
        street = "college ave";
        city = "greensboro";
        state = "NC";
        System.out.println(street +", "+ city +", "+ state );

        // example with Boolean
        boolean accountOverdrawn = false;
        System.out.println(accountOverdrawn);

        // example witn Constant
        final float PI = 3.14159265358979323846264338327950288419716939937510F;       //need a F to declare float
        final double PI_D = 3.14159265358979323846264338327950288419716939937510;       //default is double
        System.out.println("PI float: "+ PI);
        System.out.println("PI double: "+ PI_D);  //note all types treated as string with "+" concat
   
        final char UP = 'U';   //char use single quote '
        byte initialLevel = 12;
        short location = 13250;
        int score = 3500100;
        boolean newGame = true;
        System.out.println("Level: "+ initialLevel);
        System.out.println("Up: "+ UP);

        //float and double example
        float piValue = 3.1415927F;
        double x = 12e22;   // can use e or E for double
        double y = 12E-95;
        System.out.println(piValue);
        System.out.println("x = " + x);
        System.out.println("y = " + y);
        System.out.println("x*y = " + x*y);

        //character escape codes
        System.out.println("\n new line");  //new line
        System.out.println("\t tab1 \t tab2");  //tab
        System.out.println("\\ \"");  //backslash & double quote "  
        //and many others

        //boolean example
        boolean extralife = (85 > 75) || (1 == 0);
        System.out.println(extralife);
    }

}
