您的位置:首页 > 编程语言 > Java开发

Some point on learning Java

2006-09-25 15:05 309 查看
1.By using Keyword Interface, java allow you to fully utilize the "One interface, multiple methods" aspect
 of polymorphism.

2.Variables can be declared in an interface, but they are implicitly public,
static, and final.
  Since a large program is typically held in a number of separate source files,
  there needs to be a convenient way to make these constants available to each file.
  In java, interface variables offer a solution.

3. Exception

    In java, all exception classes are derived from a class called Throwable.

4. Using Java's Type wrappers to convert numeric strings

5. Enumeration
        The key is to remember that each of the enumeration constants is an object of the
        class in which it is defined.

6. Static import
        By following import whith the keyword static ,an import statement can be used to import
        the static members of a class or interface.
   
 Note: 1. when an interface is declaired as public, it should reside in a file with the same name.
       2. since the superclass of all exceptions is Throwable, to catch all possible exceptions, catch Throwable.
               If you want to catch exceptions of both a superclass type and a subclass type, put the subclass first in the catch sequence.
              
 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐