- Variables have specific lifetime and once they are destroyed they can no longer be accessed.
- The life of a varibale is known as it's scope.
- The scope of a variable is the code block it was defined in
- Variables defined in a method are known as local scope
- Paramters are localy scoped
- Variables are available in nested code blocks (children only)
- Variables defined in a code block are NOT available to parent blocks
- object variables are available to all methods and must have a object created in order to use.
- static varaibles are class wide so only one instance of them will exist per class
- private modifier means that only that class has access to the methods/attributes
- public means all classes have access
- default means that only classes in the same package will have access (as if they were public) all other classes will see the class as private.
- Object scoped variables can be shadowed by locally scoped variables.
- classes can share the same name as long as they are in different packages
- A fully qualified class name is the package name followed by the class name (seperated with full stops)