Member variables in a class -----these are called fields.
 Variables in a method or block of code ----- these are called local variables.
 Variables in method declarations ----these are called parameters.

解决方案 »

  1.   

    the if-else statement :once a condition is satisfied, the appropriate statements are
    executed and the remaining conditions are not evaluated.the switch statement : can have a number of possible execution paths. A switch works with the byte,short, char, and int primitive data types. It also works with enumerated types, the String class , and a few special classes that wrap certain primitive types: Character, Byte, Short and Integer.
      

  2.   

    As with methods , the Java platform differentiates constructors on the basis of the 
    number of arguments in the list and their types.
      

  3.   

    是java7还是java6啊,java6是不支持switch (String) 的
      

  4.   

    楼上   当然是  针对最新的JAVA7的
      

  5.   

    SwitchStatement:
       switch ( Expression ) SwitchBlockThe type of the Expression must be char, byte, short, int, Character, Byte,
    Short, Integer, String, or an enum type (§8.9), or a compile-time error occurs.The Java™ Language Specification Java SE 7 Edition,P380
      

  6.   

    when a method uses a class name as its return type, the class of the type of the returned object must be either a subclass of, or the exact class of, the return type.you also can use interface names as return types. In this case, the object returned must implement the specified interface.within an instance method or a constructor, this is a reference to the current object---the object whose method or constructor is being called.the most common reason for using the this keyword if because a field is shadowed by a  method or constructor parameter.within a constructor, use the this keyword to call another constructor in the same  class is called explicit constructor invovation.  the invocation of another constructor must be the first line in the constructor.
      

  7.   

    within a constructor, use the this keyword to call another constructor in the same class is called explicit constructor invovation. the invocation of another constructor must be the first line in the constructor.
      

  8.   

    class methods cannot use the this keword as there is no instance for this to 
    refer to.
      

  9.   

    a class methods cannot use the this keyword as there is no instance 
    for this to refer to.
      

  10.   

    a class declaration names the class and encloses the class body between braces.
    The class name can be preceded by modifiers. The class body contains fields , methods
    ,and cnstructors for the class. A class uses fields to contain state information
    and uses methods to implement behavior. Constructors that initialize a new instance 
    of a class use the name of the class and look like methods without a return type.