09-23-2013

posted Sep 23, 2013, 8:41 AM by Samuel Konstantinovich   [ updated Sep 23, 2013, 11:03 AM ]
Goal: Go over assignment, discuss terminology

Reserved Words
    Terms used for specific java commands. They also cannot be used as variable,class,method,.. names. 
     Examples (public,import,static,int) All these words are listed (head first pg 53, software solutions pg 31)

Variables
    Terms used to represent a piece of memory. Basically they are shorthand for locations in memory. They must be   
     declared before use and must have a type.
   int x; 
   x=5;
   This int x; is called declaration. You are declaring that you will use this variable in your program. This creates a piece of memory for your program to refer to. You may not use any reserved words, put spaces in the names of the variable, or start with a number. "Bank Account" is not acceptable, but BankAccount is.

Class Names
     Class names have the same restrictions as variable names. It is a java convention to capitalize the name of the class. 

Literals
   Constants whose values are written out (not put in a variable)
    -Numbers like 103, 5.23, and 0.000123 are numerical literals.
    -Character literals may be represented as any single symbol inside single quotes e.g. 'a' 'G' '&' '_' etc.  Some useful ones are '\n' and '\t' which mean new line and tab respectively.
    -String literals are any groups of characters in between double quotes "asdf" , "abby" , "" (empty string) , "1234" is not a number.

Symbols
Symbols
   - {, }, (, ), [, ], ; , math operators (+/-/%/*)

Overview of a class-
     ---
Comments