Some point on learning Java

来源:互联网 发布:淘宝客服外包合算吗 编辑:程序博客网 时间:2024/04/30 05:35
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.
              
 
原创粉丝点击