SCJP

  1. How java organized classes? which statements to give programmers a consistent way to manage naming of, and access to, classes they need?
    organized classes into packages, use import statements.
  2. Identifiers:
    can begin with a letter, a currency character($), or a underscore(_); can be of any
    length; case-sensitive.
    sun recommends(all use camelCase):
    classes & interfaces: first letter capitalized, classes use nouns, interfaces use adjectives.
    methods:first letter lowercase, verb-noun pairs.
    veriables: first letter lowercase.
    constants: using uppercase letters with underscore characters as separators.
  3. JavaBeans: Java classes that have properties.
    JavaBeans methods must be named using camelcawe, and must start with get, is(only when prperty is a boolean), set, add(followed by the listener type), and remove(followed by the listener type).
    Setter method signatures must be marked public, with a void return ype and an argument that matches the argument type of the setter method for that property.
    Getter method signatures must be marked public, take no arguments, and have a return type that matches the argument type of the setter method for that property.
    The type of listener to be added or removed must be passed as the argument to the method.
    Listener method names must end with the word "Listener".
Author
mosquitolwz
ID
25688
Card Set
SCJP
Description
java
Updated