niusouti.com

单选题假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?()A cd myprj/src javac –d ../classes school/Student.javaB cd myprj/src javac ../classes school/*.javaC cd myprj javac –d ../classes school/*.javaD cd myprj/

题目
单选题
假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?()
A

cd myprj/src javac –d ../classes school/Student.java

B

cd myprj/src javac ../classes school/*.java

C

cd myprj javac –d ../classes school/*.java

D

cd myprj/src/school javac –d ../classes school/Student.java


相似考题
参考答案和解析
正确答案: B
解析: 暂无解析
更多“单选题假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?()A cd myprj/src javac –d ../classes school/Student.javaB cd myprj/src javac ../classes school/*.javaC cd myprj javac –d ../classes school/*.javaD cd myprj/”相关问题
  • 第1题:

    下列说法正确的有()

    A.环境变量可在编译sourcecode时指定

    B.在编译程序时,所能指定的环境变量不包括classpath

    C.javac一次可同时编译数个Java源文件

    D.javac.exe能指定编译结果要置于哪个目录(directory)


    正确答案:BCD

  • 第2题:

    下列Java命令中,哪一个可以编译HelloWorld.java文件?

    A、javaHelloWorld

    B、javaHelloWorld.java

    C、javacHelloWorld

    D、javacHelloWorld.java


    正确答案:D

  • 第3题:

    在下面哪个web应用目录中可以放置所需要的class文件?()  

    • A、 /WEB-INF/lib
    • B、 /META-INF/lib
    • C、 /classes 放置已经编译的类文件
    • D、 /WEB-INF/classes

    正确答案:D

  • 第4题:

    假设在目录myprj/src/school中有Java源文件Student.java,编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令来执行这个类?()  

    • A、cd myprj/src  java ../classes school.Student
    • B、cd myprj/src/school  java –cp ../classes school.Student
    • C、cd myprj/src/school  java –cp ../../classes school.Student
    • D、cd myprj/src  java –cd ../classes school.Student

    正确答案:C

  • 第5题:

    用Javac编译Java源文件后得到代码叫字节码。


    正确答案:错误

  • 第6题:

    如果编译源程序时出现“javac不是内部或外部命令的错误”,如何办()

    • A、用setclasspath命令设置java类查找路径
    • B、下载浏览器的java虚拟机并安装
    • C、执行命令应到java源程序文件所在目录进行操作
    • D、用path命令将javac.exe文件所在路径放到dos的搜索路径中

    正确答案:D

  • 第7题:

    使用javac命令编译java的源程序时,不需要给出来文件的扩展名java。


    正确答案:错误

  • 第8题:

    Given the following directory structure: bigProject |--source ||--Utils.java| |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result?()

    • A、If the compile is successful, Utils.class is added to the source directory.
    • B、The compiler returns an invalid flag error.
    • C、If the compile is successful, Utils.class is added to the classes directory.
    • D、If the compile is successful, Utils.class is added to the bigProject directory.

    正确答案:C

  • 第9题:

    判断题
    用Javac编译Java源文件后得到代码叫字节码。
    A

    B


    正确答案:
    解析: 暂无解析

  • 第10题:

    单选题
    Given the following directory structure: bigProject |--source ||--Utils.java| |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result?()
    A

    If the compile is successful, Utils.class is added to the source directory.

    B

    The compiler returns an invalid flag error.

    C

    If the compile is successful, Utils.class is added to the classes directory.

    D

    If the compile is successful, Utils.class is added to the bigProject directory.


    正确答案: D
    解析: 暂无解析

  • 第11题:

    单选题
    假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?()
    A

    cd myprj/src javac –d ../classes school/Student.java

    B

    cd myprj/src javac ../classes school/*.java

    C

    cd myprj javac –d ../classes school/*.java

    D

    cd myprj/src/school javac –d ../classes school/Student.java


    正确答案: A
    解析: 暂无解析

  • 第12题:

    单选题
    如果编译源程序时出现“javac不是内部或外部命令的错误”,如何办()
    A

    用setclasspath命令设置java类查找路径

    B

    下载浏览器的java虚拟机并安装

    C

    执行命令应到java源程序文件所在目录进行操作

    D

    用path命令将javac.exe文件所在路径放到dos的搜索路径中


    正确答案: A
    解析: 暂无解析

  • 第13题:

    JDK中,用( )命令对其源文件进行编译,生成字节码文件。

    A.java.exe

    B.javac.exe

    C.javadoc.exe

    D.javap.exe


    正确答案:B
    本题考查JDK实用工具的使用。选项A错误,java.exe是Java语言解释器,直接从类文件执行Java应用程序字节代码,可接受class文件并启动Java虚拟机执行;选项B正确,javac.exe是Java语言编译器,将Java源代码转换成字节码;选项C错误,javadoc.exe是根据Java源代码及说明语句生成HTML,文档;选项D错误,javap.exe是反汇编器,显示编译类文件中的可访问功能和数据,同时显示字节代码含义。

  • 第14题:

    如果Java源文件中包含了多个类,那么用编译器javac编译完源文件后将生成多个扩展名为.class的文件。()

    此题为判断题(对,错)。


    答案:对

  • 第15题:

    使用JDK开发Java程序时,编译一个源文件使用的命令是()

    • A、javac
    • B、java
    • C、appletviewer
    • D、javap

    正确答案:A

  • 第16题:

    假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?() 

    • A、cd myprj/src javac –d ../classes school/Student.java
    • B、cd myprj/src javac ../classes school/*.java
    • C、cd myprj javac –d ../classes school/*.java
    • D、cd myprj/src/school javac –d ../classes school/Student.java

    正确答案:D

  • 第17题:

    编译和解析执行一个java应用程序应分别采用的命令是()

    • A、Java和Javac
    • B、Javap和Java
    • C、Javac和Java
    • D、Javac和Jdb

    正确答案:C

  • 第18题:

    Java源文件扩展名是()

    • A、.class
    • B、.java
    • C、.jav
    • D、.cla

    正确答案:B

  • 第19题:

    在JAVA编程中,以下()命令能够将Java源文件转换为类文件。

    • A、appletviewer
    • B、java
    • C、javac
    • D、以上所有选项都不正确

    正确答案:C

  • 第20题:

    Given the following directory structure: bigProject |--source | |--Utils.java | |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result? ()

    • A、If the compile is successful, Utils.class is added to the source directory.
    • B、The compiler returns an invalid flag error.
    • C、If the compile is successful, Utils.class is added to the classes directory.
    • D、If the compile is successful, Utils.class is added to the bigProject directory.

    正确答案:C

  • 第21题:

    单选题
    假设在目录myprj/src/school中有Java源文件Student.java,编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令来执行这个类?()
    A

    cd myprj/src  java ../classes school.Student

    B

    cd myprj/src/school  java –cp ../classes school.Student

    C

    cd myprj/src/school  java –cp ../../classes school.Student

    D

    cd myprj/src  java –cd ../classes school.Student


    正确答案: B
    解析: 暂无解析

  • 第22题:

    单选题
    Given the following directory structure: bigProject |--source ||--Utils.java| |--classes |-- And the following command line invocation: javac -d classes source/Utils.java Assume the current directory is bigProject,what is the result?()
    A

    If the compile is successful, Utils.class is added to the source directory.

    B

    The compiler returns an invalid flag error.

    C

    If the compile is successful, Utils.class is added to the classes directory.

    D

    If the compile is successful, Utils.class is added to the bigProject directory.


    正确答案: D
    解析: 暂无解析

  • 第23题:

    单选题
    Given: Which command-line invocations will compile?()
    A

    javac Mule.java

    B

    javac -source 1.3 Mule.java

    C

    javac -source 1.4 Mule.java

    D

    javac -source 1.5 Mule.java


    正确答案: A
    解析: 暂无解析

  • 第24题:

    单选题
    Report Card shows parents ______.
    A

    certain school rules

    B

    after—school activities

    C

    plans for classes and tests

    D

    children’s school life and work


    正确答案: B
    解析:
    从Report Card一栏里“Report card about your school life and work will be given to your parents.”可知选D。