2. The extension name of a Java bytecode file is _______.A. .java B. .obj C. .class D. .exe

题目

2. The extension name of a Java bytecode file is _______.A. .java   B.  .obj      C. .class     D.  .exe


相似考题

1.【Java代码】import Java.util.ArrayList;import java.util.List;(1) class AbstractFile{protected String name;public void printName(){System.out.println(name);}public abstract boolean addChild(AbstractFile file);public abstract boolean removeChild(AbstractF ile file);public abstract List<AbstractFile> getChildren();}class File extends AbstractFile{public File(String name){this.name=name;}public boolean addChild(AbstractFile file){return false;}public boolean removeChild(AbstractFile file){return false;}public List<AbstractFile> getChildren(){return (2) ;}}class Folder extends AbstractFile{private List <AbslractFile> childList;public Folder(String name){this.name=name;this.childList=new ArrayList<AbstractFile>();}public boolean addChild(AbstractFile file) { return childList.add(file);}public boolean removeChild(AbstractFile file){return childList.remove(file);}public (3) <AbstractFile> getChildren(){return (4) ;}}public class Client{public static void main(String[] args){//构造一个树形的文件/目录结构AbstractFile rootFolder= new Folder("c:\\ ");AbstractFile compositeFolder=new Folder("composite");AbstractFile windowsFolder=new Folder("windows");AbstractFile file=new File("TestComposite.java");rootFolder.addChild(compositeFolder) ;rootFolder.addChild(windowsFolder);compositeFolder.addChild(file) ;//打印目录文件树printTree(rootFolder);}private static void printTree(AbslractFile ifile){ifile.printName();List <AbslractFile> children=ifile.getChildreno:if(children==null) return;for (AbstractFile file:children) {(5) ;}}}该程序运行后输出结果为:c:\compositeTestComposite.javaWindows

参考答案和解析

答案c

翻译:在对Java字节码文件的扩展名是

class文件java编译后的文件,它不是源代码,真正的java源代码是.java文件。 java源代码是txt格式的.java文件,用记事本就可以打开。

更多“2. The extension name of a Java bytecode file is _______.A..javaB..objC..classD..exe”相关问题
  • 第1题:

    阅读下列说明和c++代码,将应填入 (n) 处的字句写在答题纸的对应栏内。

    【说明】

    现欲构造一文件/目录树,采用组合(Composite)设计模式来设计,得到的类图如6—7所示:

    【c++代码】

    include<1ist>

    include

    include

    using namespace std;

    class AbstractFile{

    protected:

    string name;//文件或目录名称

    public:

    void printName(){cout<*getChildren()=0; //获得一个目录的子目录或文件

    };

    class File:public AbstractFile{

    public:

    File(string name){ (1) =name;)

    void addChild(AbstractFile*file){return ;)

    void removeChiid(AbstractFile*file){return;}(2) getChildren(){return ( 3 ) ;}

    };

    class Folder:public AbstractFile{

    private:

    listchildList; //存储子目录或文件

    public:

    Folder(string name){ (4) =name;}

    void addChild(AbstractFile*file){childList.push back(file);}

    void removeChiid(AbstractFile*file)(chiidList.remove(file);}

    list*getChildren(){return (5) ;)

    };

    voidmain(){

    //构造一个树形的文件/目录结构

    AbstractFile*rootFolder=new Folder(“C:\\”);

    AbstractFile*compositeFolder=flew Folder(”composite”);

    AbstractFile*windowsFolder=new Folder(”windows”);

    AbstractFile*file=new File(”TestComposite.java”);

    rootFolder->addChild(compositeFolder);

    rootFolder->addChild (windowsFolder);

    compositeFolder->addChiid(file);

    )


    正确答案:(1)this一>name(2)list<AbstractFile*>*(3)NULL(4)this->name(5)&childList
    (1)this一>name(2)list<AbstractFile*>*(3)NULL(4)this->name(5)&childList 解析:Composite模式定义:将对象以树型结构组织起来,以达成“部分一整体”的层次结构,使得客户端对单个对象和组合对象的使用具有一致性。Composite比较容易理解,想到Composite就应该想到树形结构图。组合体内这些对象都有共同接口,当组合体一个对象的方法被调用执行时,Composite将遍历(Iterator)整个树形结构,寻找同样包含这个方法的对象并实现调用执行。AbstractFile为一个抽象文件类,其作用主要是实现对文件或者文件夹的抽象。文件类File继承自AbstractFile。File(stringname)为File类的一个属性,用于获取文件名称。Addchild方法用来给一个目录增加子目录或文件。Removechild方法用于删除一个目录的子目录或文件。Getchildren方法用于获取一个目录或文件,所以返回值类型应该是一个列表形式的AbstractFile,但文件本身不包括子目录,故返回NULL。Fold类表示一个文件夹,属性Fold.er用于获取文件夹名称,Getchildren方法返回值应为List型的AbstractFile对象指针。

  • 第2题:

    下列程序中,要求输出一个特定文件(这里是ex2_1.java)的相关信息,包括文件的名字,相对路径以及文件的长度。请将程序补充完整。

    程序运行结果如下:

    name:ex2_1.java

    path:ex2_1.java

    length: 299

    import java.io.*;

    public class ex2_1{

    public static void main(String[] args) {

    File file2_1 = new File("ex2_1.java");

    System.out.println("name:"+file2_1.____________ );

    System.out.println("path:"+file2_1.____________ );

    System.out.println("length:"+file2_1.____________ );

    }

    }


    正确答案:getName() getPath() length()
    getName() getPath() length() 解析:本题主要考查Java文件以及Java类库中的File类的常用方法。解题关键是熟记Java的File类的常用方法:getName(), getPath(),length()等。在本题中,这3个空分别对应填入这3个方法即可。

  • 第3题:

    下列语句正确的有()

    • A、<%@ include file=”head.jsp”%> 
    • B、<% String url=”head.jsp”;%><%@ include file=”url”%> 
    • C、<%@ include file=”head.jsp”?name=”lovo”%> 
    • D、<%String companyName=”lovo”;%>%@include file”head.jsp”?name=‟companyName”% 

    正确答案:B

  • 第4题:

    Which statements about Java code security are true?() 

    • A、 The bytecode verifier loads all classes needed for the execution of a program.
    • B、 Executing code is performed by the runtime interpreter.
    • C、 At runtime the bytecodes are loaded, checked and run in an interpreter.
    • D、 The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.

    正确答案:B,C,D

  • 第5题:

    编译Java程序file.java后生成的程序是()。

    • A、file.html
    • B、File.class
    • C、file.class
    • D、file.jar

    正确答案:C

  • 第6题:

    Which gets the name of the parent directory file “file.txt”?()

    • A、 String name= File.getParentName(“file.txt”);
    • B、 String name= (new File(“file.txt”)).getParent();
    • C、 String name = (new File(“file.txt”)).getParentName();
    • D、 String name= (new File(“file.txt”)).getParentFile();
    • E、 Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();

    正确答案:B

  • 第7题:

    You have forgotten the name of binary PL/SQL library saved to the operating system. This file contains the PL/SQL constricts you created for the inventory report. For which file extension should you reach?()

    • A、 .SQL 
    • B、 .PLL 
    • C、 .PLD
    • D、 .PRT

    正确答案:B

  • 第8题:

    如果你想要自动加载类,下面哪种函数声明是正确的?()

    • A、function autoload($class_name)
    • B、function__autoload($class_name,$file)
    • C、function__autoload($class_name)
    • D、function_autoload($class_name)
    • E、function autoload($class_name,$file)

    正确答案:C

  • 第9题:

    多选题
    Which statements about Java code security are true?()
    A

    The bytecode verifier loads all classes needed for the execution of a program.

    B

    Executing code is performed by the runtime interpreter.

    C

    At runtime the bytecodes are loaded, checked and run in an interpreter.

    D

    The class loader adds security by separating the namespaces for the classes of the local file system from those imported from network sources.


    正确答案: A,C
    解析: SL275中描述的Java程序运行的过程是这样的:类加载器(class loader)加载程序运行所需要的所有类,它通过区分本机文件系统的类和网络系统导入的类增加安全性,这可以限制任何的特洛伊木马程序,因为本机类总是先被加载,一旦所有的类被加载完,执行文件的内存划分就固定了,在这个时候特定的内存地址被分配给对应的符号引用,查找表(lookuo table)也被建立,由于内存划分发生在运行时,解释器在受限制的代码区增加保护防止未授权的访问;然后字节码校验器(byte code verifier)进行校验,主要执行下面的检查:类符合JVM规范的类文件格式,没有违反访问限制,代码没有造成堆栈的上溢或者下溢,所有操作 代码的参数类型都是正确的,没有非法的数据类型转换(例如将整型数转换成对象类型)发生;校验通过的字节码被解释器(interpreter)执行,解释器在必要时通过运行时系统执行对底层硬件的合适调用。后三个答案是SL275中的原话。

  • 第10题:

    单选题
    Which gets the name of the parent directory file “file.txt”?()
    A

     String name= File.getParentName(“file.txt”);

    B

     String name= (new File(“file.txt”)).getParent();

    C

     String name = (new File(“file.txt”)).getParentName();

    D

     String name= (new File(“file.txt”)).getParentFile();

    E

     Directory dir=(new File (“file.txt”)).getParentDir();  String name= dir.getName();


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

  • 第11题:

    单选题
    Which file characteristic cannot be used in the Cisco IronPort Data Security policies?()
    A

     file type

    B

     file size

    C

     file age

    D

     file  name


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

  • 第12题:

    多选题
    为文件c:/java/example/file.txt建立File对象file1可以采用()语句序列。
    A

    File file 1=new File(“c://java//example//file.txt”)

    B

    String path=”c:/java/example/”Filefile1=newFile(path,”oldfile.txt”)

    C

    File dir 1=new File(“c://java//example”)Filefile1=newFile(dir1,”oldfile.txt”)

    D

    File file 1=new File(“c:/java//example/file.txt”)


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

  • 第13题:

    阅读下列说明和Java代码,将应填入 (n) 处的字句写在答题纸的对应栏内。

    【说明】

    现欲构造一文件/目录树,采用组合(Composite)设计模式来设计,得到的类图如6—8所示:

    【Java代码】

    import JavA.util.ArrayList;

    import JavA.util.List;(1)class AbstractFile{

    protected String name;

    public void printName(){System.out.println(name);}

    public abstract boolean addChild(AbstractFile file);

    public abstract boolean removeChild(AbstractFile file);

    public abstract ListgetChildren {};

    }

    class File extends AbstractFile{

    public File(String name)(this.name=name;}

    public boolean addChild(AbstractFile file){return false;}

    public boolean removeChild(AbstractFile file){return false;}

    public ListgetChildren(){return (2) ;)

    }

    clasS Folder extends AbstractFile{

    private ListchildList;

    public Folder(String name){

    thiS.name=name;

    this.childList=new ArrayList{};

    }

    public boolean addChild(AbstractFile file){return childList.add(file);}

    public boolean removeChild(AbstractFile file){return childList.remove(file);

    public (3)getChildren(){return (4) ;)

    }

    public class Client{

    public static void main(String[]args){

    //构造一个树形的文件/目录结构

    AbstractFile rootFolder=new Folder(“C:\”’);

    AbstractFile compositeFolder=new Folder(”composite”);

    AbstractFile windowsFolder=new Folder(”windows”);

    AbstractFile file=new File(”TestComposite.java”);

    rootFOlder.addChild (compositeFolder);

    rootFolder.addChiid(windowsFolder);

    compositeFolder.addChild(file);

    //打印目录文件树

    printTree(rootFolder);

    }

    private static void printTree(AbstractFile ifile){

    ifile.PrIntName();

    Listchildren:ifile.getChildren ();

    if(chiidren==null)return;

    for(AbstractFile file:children){(5) ;

    }

    }

    }

    该程序运行后输出结果为:

    C:\

    composite

    TestComposite.java

    Windows


    正确答案:(1)Abstract(2)null(3)List(4)childList(5)printTree(file)
    (1)Abstract(2)null(3)List(4)childList(5)printTree(file) 解析:Composite模式定义:将对象以树型结构组织起来,以达成“部分-整体”的层次结构,使得客户端对单个对象和组合对象的使用具有一致性。Composite比较容易理解,想到Composite就应该想到树型结构图。组合体内这些对象都有共同接口,当组合体一个对象的方法被调用执行时,Composite将遍历(Iterator)整个树形结构,寻找同样包含这个方法的对象并实现调用执行。AbstractFile为一个抽象文件类,其作用主要是实现对文件或者文件夹的抽象。文件类File继承自AbstractFile。File(stringname)为File类的一个属性,用于获取文件名称。Add-child方法用来给一个目录增加子目录或文件。Removechild方法用于删除一个目录的子目录或文件。Getchildren方法用于获取一个目录或文件,所以返回值类型应该是一个列表形式的AbstractFile,但文件本身不包括子目录,故返回NUIJIJ。Fold类表示一个文件夹,属性Folder用于获取文件夹名称,Getchildren方法返回值应为List型的AbstractFile对象指针。

  • 第14题:

    Which file characteristic cannot be used in the Cisco IronPort Data Security policies?() 

    • A、 file type
    • B、 file size
    • C、 file age
    • D、 file  name

    正确答案:C

  • 第15题:

    public class test {  public static void main(String [] a) {  assert a.length == 1;  }  }  Which two will produce an AssertionError?()

    • A、 java test
    • B、 java -ea test
    • C、 java test file1
    • D、 java -ea test file1
    • E、 java -ea test file1 file2
    • F、 java -ea:test test file1

    正确答案:B,E

  • 第16题:

    为文件c:/java/example/file.txt建立File对象file1可以采用()语句序列。

    • A、File file 1=new File(“c://java//example//file.txt”)
    • B、String path=”c:/java/example/”Filefile1=newFile(path,”oldfile.txt”)
    • C、File dir 1=new File(“c://java//example”)Filefile1=newFile(dir1,”oldfile.txt”)
    • D、File file 1=new File(“c:/java//example/file.txt”)

    正确答案:A,B,C

  • 第17题:

    Which of the following will occur if an operator types the command vi file.out?()

    • A、If the file exists it will be opened for editing. If the file does not exist an error message will be displayed.
    • B、If the file exists it will be opened for editing. If the file does not exist a new file with the name file.out will be created and opened for editing.
    • C、If the file exists an error message will be displayed. If the file does not exist a new file with the name file.out will be created and opened for editing.
    • D、If the file exists the operator will be asked whether to open the file or overwrite the file. If the file does not exist a new file with the name file.out will be created and opened for editing.

    正确答案:B

  • 第18题:

    You deployed a Java EE Shared Library and want to use it from an application that is also deployed on the same cluster.    Which two manifest attributes must be specified at a minimum with corresponding values in the deployment descriptor of the application that requires?()

    • A、Implementation-Version
    • B、Specification-Version
    • C、Extension-Name  
    • D、Specification-Vendor
    • E、Implementation-Vendor

    正确答案:A,C

  • 第19题:

    When performing a database duplication, which duplicate database parameter would you set to ensure that the online redo logs are created in the correct location?()  

    • A、 log_file_name_convert
    • B、 convert_log_file_name
    • C、 file_name_convert_log
    • D、 redo_log_file_name_convert
    • E、 logfile_convert_directory

    正确答案:A

  • 第20题:

    单选题
    Which of the following will occur if an operator types the command vi file.out?()
    A

    If the file exists it will be opened for editing. If the file does not exist an error message will be displayed.

    B

    If the file exists it will be opened for editing. If the file does not exist a new file with the name file.out will be created and opened for editing.

    C

    If the file exists an error message will be displayed. If the file does not exist a new file with the name file.out will be created and opened for editing.

    D

    If the file exists the operator will be asked whether to open the file or overwrite the file. If the file does not exist a new file with the name file.out will be created and opened for editing.


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

  • 第21题:

    单选题
    下列语句正确的有()
    A

    <%@ include file=”head.jsp”%> 

    B

    <% String url=”head.jsp”;%><%@ include file=”url”%> 

    C

    <%@ include file=”head.jsp”?name=”lovo”%> 

    D

    <%String companyName=”lovo”;%>%@include file”head.jsp”?name=‟companyName”% 


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

  • 第22题:

    单选题
    When performing a database duplication, which duplicate database parameter would you set to ensure that the online redo logs are created in the correct location?()
    A

     log_file_name_convert

    B

     convert_log_file_name

    C

     file_name_convert_log

    D

     redo_log_file_name_convert

    E

     logfile_convert_directory


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

  • 第23题:

    单选题
    You have forgotten the name of binary PL/SQL library saved to the operating system. This file contains the PL/SQL constricts you created for the inventory report. For which file extension should you reach?()
    A

     .SQL 

    B

     .PLL 

    C

     .PLD

    D

     .PRT


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