当前位置: 技术问答>java相关
scjp的一题,请讲答案,同理由。
来源: 互联网 发布时间:2015-08-04
本文导语: You have just created a few classes in a source file called Server.java. There is a main class called Server, which begins the program. The top of this file has the line: package com.syngress; Which of the following procedures will work?...
You have just created a few classes in a source file called Server.java. There is a main class called Server, which begins the program. The top of this file has the line:
package com.syngress;
Which of the following procedures will work?
A. You place the classes in the directory Server, and type the following:
c:Java PackagescomsyngressServer>java Server
B. You place the classes in the directory syngress,and type the following:
c:Java PackagescomsyngressServer>java com.syngress.Server
C. You place the classes in the directory syngress,and type the following:
c:Java Packagescomsyngress>java Server
D. You place the classes in the directory Server, and type the following:
c:>java com.syngress.Server
E. None of above.
package com.syngress;
Which of the following procedures will work?
A. You place the classes in the directory Server, and type the following:
c:Java PackagescomsyngressServer>java Server
B. You place the classes in the directory syngress,and type the following:
c:Java PackagescomsyngressServer>java com.syngress.Server
C. You place the classes in the directory syngress,and type the following:
c:Java Packagescomsyngress>java Server
D. You place the classes in the directory Server, and type the following:
c:>java com.syngress.Server
E. None of above.
|
用意climate(),的确没有一个可以运行成功,当有包存在时,将类放到
c:Java Packagescomsyngress里,然后在退到c:Java Packages>
键入java com.syngress.Server运行该类.
c:Java Packagescomsyngress里,然后在退到c:Java Packages>
键入java com.syngress.Server运行该类.
|
com.syngress.Server 执行方法为:
/当前位置/com/syngress/Server.calss,在当前位置执行java com.syngress.Server.
原因是:package com.syngress;
/当前位置/com/syngress/Server.calss,在当前位置执行java com.syngress.Server.
原因是:package com.syngress;
|
应该是D