English 中文(简体)
a. j源档案中的主要类别?
原标题:the main class in a java source file?
  • 时间:2010-01-09 16:56:03
  •  标签:
  • java

new。

在我为净户设立新项目后制定的标准守则是:

package helloworldapp;

public class Main {

    public static void main(String[] args) {
        int[] array = new int[10];
        array[9] = 1;

        System.out.println(array[9]);
    }
}

因此,你发现它使用该系统类别,但一意是该类别已经进口。 是否有其他法典? 如果不进口,如何使用。

最佳回答

系统分类与<编码>java.lang中的其他一切一起自动进口。 您可能使用自动进口的其他课程包括<条码> 标准和<条码>Exception<>。

问题回答

其他信息:

如果不进口,如何使用。

您可以使用完全合格的名称,在另一个包裹中使用任何类别,而没有进口<>。 例:

    java.util.Date now = new java.util.Date();

而不是

import java.util.Date;  // or java.util.*;
...
    Date now = new Date();

Update:
import is only used at compile time to determine the fully qualified name of classes.

System载于java.lang的包裹,所有 Java方案均可自动获得。

载有所有标准的文件 Java门课程是编造者(javac)和java指挥部使用的默认搜索算法的一部分。 如其他答复所述,java.lang和java.util是你重新撰写的法典自动提供系统课程的例子。

载有这些类别的联合调查组档案可查到目前使用的您机器的JDK安装名录。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签