定义:
Button t=new Button("ok");
声明:
Button t;

解决方案 »

  1.   

    摘自 SUN 网站上的 java 语言规范:http://java.sun.com/docs/books/jls/second_edition/html/j.title.doc.html
    6.1 Declarations
    A declaration introduces an entity into a program and includes an identifier (§3.8) that can be used in a name to refer to this entity. A declared entity is one of the following:A package, declared in a package declaration (§7.4) 
    An imported type, declared in a single-type-import declaration (§7.5.1) or a type-import-on-demand declaration (§7.5.2) 
    A class, declared in a class type declaration (§8.1) 
    An interface, declared in an interface type declaration (§9.1) 
    A member of a reference type (§8.2, §9.2, §10.7), one of the following: 
    A member class (§8.5, §9.5). 
    A member interface (§8.5, §9.5). 
    A field, one of the following: 
    A field declared in a class type (§8.3) 
    A constant field declared in an interface type (§9.3) 
    The field length, which is implicitly a member of every array type (§10.7) 
    A method, one of the following: 
    A method (abstract or otherwise) declared in a class type (§8.4) 
    A method (always abstract) declared in an interface type (§9.4) 
    A parameter, one of the following: 
    A parameter of a method or constructor of a class (§8.4.1, §8.8.1) 
    A parameter of an abstract method of an interface (§9.4) 
    A parameter of an exception handler declared in a catch clause of a try statement (§14.19) 
    A local variable, one of the following: 
    A local variable declared in a block (§14.4) 
    A local variable declared in a for statement (§14.13) 
    Constructors (§8.8) are also introduced by declarations, but use the name of the class in which they are declared rather than introducing a new name