`

Java基础恶补——Development

    博客分类:
  • Java
 
阅读更多

[SCJP Sun Certified Programmer for Java 6 Study Guide (Exam 310-065)]  chapter10

一. 使用 javac 和 java
1. 使用 javac 命令时,可以用 -d 改变class文件的目的地。

2. The -d option can build package-dependent destination classes on-the-fly if the root package directory already exists.

3. 使用 java 命令时,可以用 -D 来使用系统变量。

4. System properties consist of name=value pairs that must be appended directly behind the -D, for example, java -Dmyproperty=myvalue.

5. 命令行参数总是作为String来看待的。

6. The java command-line argument 1 is put into array element 0, argument 2 is put into element 1, and so on.

 

二. 用 javac 和 java 搜索
1. Both java and javac use the same algorithms to search for classes.

2. Searching begins in the locations that contain the classes that come standard with J2SE.

3. Users can define secondary search locations using classpaths.

4. Default classpaths can be defined by using OS environment variables.

5. A classpath can be declared at the command line, and it overrides the default classpath.

6. A single classpath can define many different search locations.

7. In Unix classpaths, forward slashes (/) are used to separate the directories that make up a path. In Windows, backslashes (\) are used.

8. In Unix, colons (:) are used to separate the paths within a classpath. In Windows, semicolons (;) are used.

9. In a classpath, to specify the current directory as a search location, use a dot (.)

10. In a classpath, once a class is found, searching stops, so the order of locations to search is important.

 

三. 打包和搜索
1. When a class is put into a package, its fully qualified name must be used.

2. An import statement provides an alias to a class's fully qualified name.

3. In order for a class to be located, its fully qualified name must have a tight relationship with the directory structure in which it resides.

4. A classpath can contain both relative and absolute paths.

5. An absolute path starts with a / or a \.

6. Only the final directory in a given path will be searched.

 

四. JAR 文件
1. An entire directory tree structure can be archived in a single JAR file.

2. JAR files can be searched by java and javac.

3. When you include a JAR file in a classpath, you must include not only the directory in which the JAR file is located, but the name of the JAR file too.

4. For testing purposes, you can put JAR files into .../jre/lib/ext, which is somewhere inside the Java directory tree on your machine.

 

五. 静态导入
1. You must start a static import statement like this: import static.

2. You can use static imports to create shortcuts for static members (static variables, constants, and methods) of any class.

 

分享到:
评论

相关推荐

    JavaJava Development Java语言基础

    【Java】Java Development Java语言基础 【Java】Java Development Java语言基础 【Java】Java Development Java语言基础

    JAVA 开发环境 Java SE Development Kit (JDK) 16.0.1 x64.zip

    Java SE Development Kit (JDK) 15.0 x64 免费下载Java SE Development Kit (JDK) 15.0 x64 免费下载 JDK 是什么? JDK 是整个 Java 的核心,包括了 Java 运行环境(Java Runtime Envirnment),一堆 Java 工具和 Java ...

    传智播客.黑马程序员《Java 基础入门》课后习题答案

    JDK(Java Development Kit,Java 开发工具包),它包含编译工具、解释工具、文档制作工具、打 包工具多种与开发相关的工具,是提供给 Java 开发人员使用的。初学者学习和使用 Java 语言时, 首先必须下载和安装 JDK...

    Continuous Enterprise Development in Java

    Learn a use-case approach for developing Java enterprise applications in a continuously test-driven fashion. With this hands-on guide, authors and JBoss project leaders Andrew Lee Rubinger and Aslak ...

    Java(TM)SE Development Kit6软件及安装说明

    Java(TM)SE Development Kit6软件及安装说明,包含环境配置说明,保证可用。

    Digital Java EE 7 Web Application Development epub

    Digital Java EE 7 Web Application Development 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权,请联系上传者或csdn删除

    Java笔记2013

    Java基础篇——第一章至十六章包括从Java环境控制结构到图形界面原件。多媒体等丰富内容的详细讲述。 Java进阶篇——第十七章sgl程序设计说明Java如何管理数据库:第十八章Servlet程序设计,说明Java如何在互联网...

    Pro Java 9 Games Development Leveraging the JavaFX APIs epub

    Pro Java 9 Games Development Leveraging the JavaFX APIs 英文epub 本资源转载自网络,如有侵权,请联系上传者或csdn删除 查看此书详细信息请在美国亚马逊官网搜索此书

    java基础知识思考题+答案(个人整理)

    因为Java程序编译之后的代码不是能被硬件系统直接运行的代码,而是一种“中间码”——字节码。然后不同的硬件平台上安装有不同的Java虚拟机(JVM),由JVM来把字节码再“翻译”成所对应的硬件平台能够执行的代码。因此...

    Pro_Java_6_3D_Game_Development_Table-of-Contents

    Pro Java 6 3D Game Development: Java 3D, JOGL, JInput and JOAL APIs Create strange lands filled with mysterious objects (cows frozen in <br>blocks of ice, chirping penguins, golden globes with ...

    JAVA 开发环境 Java SE Development Kit (JDK) 16.0.1 x64 免费下载.zip

    JAVA 开发环境 Java SE Development Kit (JDK) 16.0 发布啦!在 Java 中创建应用所需的基本资源,包括 Java 运行时环境,库,代码示例和演示应用。根据 TIOBE 编程社区索引,Java 编程语言是软件开发人员的最佳选择...

    java基础总结大全

    java基础大全相信大家会用到的、JVM、JRE和JDK的区别: JVM(Java Virtual Machine):java虚拟机,用于保证java的跨平台的特性。 java语言是跨平台,jvm不是跨平台的。 JRE(Java Runtime Environment):java的运行...

    Java SE Development Kit 8u202

    Java SE Development Kit 8u202

    Secure Java: For Web Application Development

    Encapsulating security requirements for web development with the Java programming platform, Secure Java: For Web Application Development covers secure programming, risk assessment, and threat ...

    Java SE Development Kit 8 Documentation

    Java SE Development Kit 8 Documentation Java SE Development Kit 8 Documentation Java SE Development Kit 8 Documentation Java SE Development Kit 8 Documentation Java SE Development Kit 8 Documentation

    【JAVA 11】 Java SE Development Kit 11.0.16.1

    JAVA11 可按需自取,有

    Component Development For Java Platform

    Component Development For Java Platform.pdf

    Mastering Java EE Development with WildFly 无水印pdf

    Mastering Java EE Development with WildFly 英文无水印pdf pdf所有页面使用FoxitReader和PDF-XChangeViewer测试都可以打开 本资源转载自网络,如有侵权,请联系上传者或csdn删除 本资源转载自网络,如有侵权...

    JAVA基础,常见java基础问题.rar

    JDK:Java Development Kit JDK顾名思义是java开发工具包,是程序员使用java语言编写java程序所需的开发工具包,是提供给程序员使用的。JDK包含了JRE,同时还包含了编译java源码的编译器javac,还包含了很多java...

    Test-Driven Java Development(PACKT,2015)

    You will finish this book with a deep understanding of the test-driven development methodology and the confidence to apply it to application programming with Java. What You Will Learn Explore the ...

Global site tag (gtag.js) - Google Analytics