import 的问题

topbasemaster 2020-06-13 01:42:27
idea 有个快捷键 就是 补充import 路径

经常会
import java.util.*;

想问 如果 我写成 这样的话
跟我写
import java.util.HashMap;

有什么区别?
我只引用一个包 和 用* 的区别
...全文
122 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
亦夜 2020-06-13
  • 打赏
  • 举报
回复
就是一个引入多个,一个引入单个,一般不会自己去写import语句,所以没什么影响
rumlee 2020-06-13
  • 打赏
  • 举报
回复
没啥区别,如果要引入一个包下面的很多个类的话,用*更省事。
大家都知道jdk1.6及以后都支持了对webService的原生态的支持;它在发布时会生成一个wsdl和一个xsd(一个类只生成一个xsd)所以就保留了...WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6. --> - <definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://jaxws.zzz/jaxws/hello" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://jaxws.zzz/jaxws/hello" name="HelloService"> - <types> - <xs:schema xmlns:tns="http://jaxws.zzz/jaxws/hello" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://jaxws.zzz/jaxws/hello"> <xs:element name="sayHello" type="tns:sayHello" /> <xs:element name="sayHelloResponse" type="tns:sayHelloResponse" /> - <xs:complexType name="sayHello"> - <xs:sequence> <xs:element name="arg0" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> - <xs:complexType name="sayHelloResponse"> - <xs:sequence> <xs:element name="return" type="xs:string" minOccurs="0" /> </xs:sequence> </xs:complexType> </xs:schema> </types> - <message name="sayHello"> <part name="parameters" element="tns:sayHello" /> </message> - <message name="sayHelloResponse"> <part name="parameters" element="tns:sayHelloResponse" /> </message> - <portType name="HelloService"> - <operation name="sayHello"> <input message="tns:sayHello" /> <output message="tns:sayHelloResponse" /> </operation> </portType> - <binding name="HelloServicePortBinding" type="tns:HelloService"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> - <operation name="sayHello"> <soap:operation soapAction="" /> - <input> <soap:body use="literal" /> </input> - <output> <soap:body use="literal" /> </output> </operation> </binding> - <service name="HelloService"> - <port name="HelloServicePort" binding="tns:HelloServicePortBinding"> <soap:address location="http://localhost:8080/services/HelloService" /> </port> </service> </definitions> 对于另一种import问题就是当我们定义一个接口一个实现类的时候...

62,627

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧