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.
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.
相关文章推荐
- Interoperability between Java and SharePoint 2013 on Premises
- PointNet: Deep Learning on Point Sets for 3D Classification and Segmentation
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- Java: some learning note for Java calssloader and Servlet
- some tips on java programming
- com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK.
- Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK(转
- some links about learning java
- Some thought about learning java
- 问题:Unable to find a javac compiler; com.sun.tools.javac.Main is not on the classpath.Perhaps JAVA_HOME does not point to the JDK
- 吴恩达 机器学习 笔记 some tips on applying machine Learning
- Dynamic Graph CNN for Learning on Point Clouds 解析
- ant 手动打包报错: com.sun.tools.javac.Main is not on the classpPerhaps JAVA_HOME does not point to the JDK
- No JVM could be found on your system. Please define EXE4J_JAVA_HOME to point to an installed 32-bit
- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
- Error:java.lang.RuntimeException: Some file crunching failed, see logs for details
- 关于打开android studioch出现the environment virable JAVA_HOME does not point to a valid JVM installation
- Fix the SharePoint DCOM 10016 error on Windows Server 2008 R2
- eclipse中以RunOnServer运行javaweb项目时没有相关javaweb项