简体   繁体   中英

Java String import java.lang.String

When I use String in Java do I need to import java.lang.String ? Or I can simply use it?

Is String imported by default? I am using Eclipse and as I know they use another compiler that Java does. What is the standard way?

不,默认情况下导入java.lang.*

You don't need to import anything from java.lang . It is imported by default. Everything in there is available without a need to explicitly import anything.

您不需要正式导入java.lang.String ..在读取代码时表示“过度冗余”。

By default, Java classes import all java.lang classes. It's pretty rare to see Java code that explicitly imports java.lang.String.

No, it is imported. use : String [name] = "[value]";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM