更多“#import跟#include的区别,@class呢?”相关问题
  • 第1题:

    有以下程序:include include using namespace std;class base{private: cha

    有以下程序: #include <iostream> #include <string> using namespace std; class base { private: char baseName[10]; public: base ( ) { strcpy (baseName, "Base"); } virtual char *myName() {

    A.DerivedBase

    B.BaseBase

    C.DerivedDerived

    D.BaseDerived


    正确答案:A
    解析:本题考核虚函数的应用。类Derived是从基类Base公有派生而来的。因此,Derived是基类Base的子类型。主函数中定义了一个基类对象bb和一个派生类对象dd。从程序中可看出,派生类Derived的对象dd交给了处理基类Base的对象的函数showPtr进行处理。由于在基类中函数myName被定义成虚函数,所以在函数showPtr中调用的myName函数为派生类的成员函数mySame,从而输出Derived。然后输出className,即基类名称Base。

  • 第2题:

    下列哪个选项的java源文件程序段是不正确的? ( )

    A.package testpackage; public class Test{ }

    B.import java.io.*; package testpackage; public class Test{ }

    C.import java.i.*; class Person{} public class Test{ }

    D.import java.io.*; import java.awt.*; public class Test { }


    正确答案:B

  • 第3题:

    #import跟#include 又什么区别,@class呢, #import<> 跟 #import””又什么区别?


    正确答案:#import是Objective-C导入头文件的关键字,#include是C/C++导入头文件的关键字,使用#import头文件会自动只导入一次,不会重复导入,相当于#include和#pragma once;@class告诉编译器某个类的声明,当执行时,才去查看类的实现文件,可以解决头文件的相互包含;#import<>用来包含系统的头文件,#import””用来包含用户头文件。

  • 第4题:

    现有包结构:  com |-- x | |-- Alpha.class | | | |-- y | |-- Beta.class | |-- Gamma.class  和类:  //insert code here  import com.*;  import com.x.y.*;  class Test { Alpha a; Beta b; Gamma c; }  哪两行分别插入后可允许代码编译?() 

    • A、package com.;
    • B、import com.x;
    • C、package com.x;
    • D、import com.x.Alpha;

    正确答案:C,D

  • 第5题:

    Which JSP standard action can be used to import content from a resource called foo.jsp?()

    • A、<jsp:import file=’foo.jsp’ />
    • B、<jsp:import page=’foo.jsp’ />
    • C、<jsp:include page=’foo.jsp’ />
    • D、<jsp:include file=’foo.jsp’ />

    正确答案:C

  • 第6题:

    在Java语言中,在包Package1中包含包Package2,类Class_A直接隶属于包Package1,类Class_B直接隶属于包Package2,在类Class_C要应用Class_A的方法A和Class_B的方法B,你需要()语句。

    • A、import Package1.*;
    • B、import Package1.Package2.*;
    • C、import Package2.*;
    • D、import Package2.Package1.*;

    正确答案:A,B

  • 第7题:

    //point X  public class foo { public static void main (String[]args) throws Exception {  java.io.printWriter out = new java.io.PrintWriter {  new java.io.outputStreamWriter (System.out), true;  out.printIn(“Hello”); }  }  }   Which statement at PointX on line 1 allows this code to compile and run?()  

    • A、 Import java.io.*;
    • B、 Include java.io.*;
    • C、 Import java.io.PrintWriter;
    • D、 Include java.io.PrintWriter;
    • E、 No statement is needed.

    正确答案:E

  • 第8题:

    Which the JSTL code snippet can be used to import content from another web resource?()

    • A、 <c:import url=*foo.jsp”/> 
    • B、 <c:import page=*foo.jsp”/> 
    • C、 <c:include url=*foo.jsp”/> 
    • D、 <c:include page=*foo.jsp”/> 
    • E、 Importing cannot be done in JSTL. A standard action must be used instead.

    正确答案:A

  • 第9题:

    Given a class Repetition:  1. package utils;  2.  3. public class Repetition {  4. public static String twice(String s) { return s + s; }  5. }  and given another class Demo:  1. // insert code here 2.  3. public class Demo {  4. public static void main(String[] args) {  5. System.out.println(twice(”pizza”));  6. }  7. }  Which code should be inserted at line 1 of Demo.java to compile and run Demo to print“pizzapizza”?() 

    • A、 import utils.*;
    • B、 static import utils.*;
    • C、 import utils.Repetition.*;
    • D、 static import utils.Repetition. *;
    • E、 import utils.Repetition.twice();
    • F、 import static utils.Repetition.twice;
    • G、 static import utils.Repetition.twice;

    正确答案:F

  • 第10题:

    问答题
    #import跟#include的区别,@class呢?

    正确答案: @class一般用于头文件中需要声明该类的某个实例变量的时候用到,在m文件中还是需要使用#import而#import比起#include的好处就是不会引起交叉编译
    解析: 暂无解析

  • 第11题:

    单选题
    //point X   public class foo {  public static void main (Stringargs) throws Exception {   java.io.printWriter out = new java.io.PrintWriter {   new java.io.outputStreamWriter (System.out), true;   out.printIn(“Hello”);   }   } }   Which statement at PointX on line 1 allows this code to compile and run?()
    A

     Import java.io.*;

    B

     Include java.io.*;

    C

     Import java.io.PrintWriter;

    D

     Include java.io.PrintWriter;

    E

     No statement is needed.


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

  • 第12题:

    单选题
    Every page of your web site must include a common set of navigation menus at the top of the page. Thismenu is static HTML and changes frequently,so you have decided to use JSP’s static import mechanism. Which JSP code snippet accomplishes this goal?()
    A

    <%@ import file=’/common/menu.html’ %>

    B

    <%@ page import=’/common/menu.html’ %>

    C

    <%@ import page=’/common/menu.html’ %>

    D

    <%@ include file=’/common/menu.html’ %>

    E

    <%@ page include=’/common/menu.html’ %>


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

  • 第13题:

    我想问会计职称考试跟会计从业资格证考试有什么区别呢?


    会计从业资格证考试是从事会计工作的敲门砖,是最基本的考试。会计职称考试只有取得从业资格证才有资格报考初级职称。



  • 第14题:

    ()标记可以从目标名称空间外的某个名称空间中导入一个XSD文件的内容

    • A、<import>
    • B、<include>
    • C、<include>和<import>都可以
    • D、<include>和<import>都不可以

    正确答案:A

  • 第15题:

    一个程序中,package、import、和class的排放次序是()

    • A、package、import、class
    • B、import、package、class
    • C、三者任意
    • D、class在最后,import、package排放次序任意

    正确答案:A

  • 第16题:

    Every page of your web site must include a common set of navigation menus at the top of the page. Thismenu is static HTML and changes frequently,so you have decided to use JSP’s static import mechanism. Which JSP code snippet accomplishes this goal?()

    • A、<%@ import file=’/common/menu.html’ %>
    • B、<%@ page import=’/common/menu.html’ %>
    • C、<%@ import page=’/common/menu.html’ %>
    • D、<%@ include file=’/common/menu.html’ %>
    • E、<%@ page include=’/common/menu.html’ %>

    正确答案:D

  • 第17题:

    在单一文件中import、class和package的正确出现顺序是()

    • A、package,import,class
    • B、class,import,package
    • C、import,package,class
    • D、package,class,import

    正确答案:A

  • 第18题:

    Which JSTL code snippet can be used to import content from another web resource?()

    • A、<c:import url="foo.jsp"/>
    • B、<c:import page="foo.jsp"/>
    • C、<c:include url="foo.jsp"/>
    • D、<c:include page="foo.jsp"/>

    正确答案:A

  • 第19题:

    下列有关类声明的代码片段,哪一项是正确的?() 

    • A、 import java.sql.*; package school; class Student{ }
    • B、 package school; import java.sql.*; class Student{ }
    • C、 package school; class Student{ } import java.sql.*;
    • D、 package school; import java.sql.*;private String name; class Student{ }

    正确答案:B

  • 第20题:

    //point X    public class foo (   public static void main (Stringargs) throws Exception {   printWriter out = new PrintWriter (new )  java.io.outputStreamWriter (System.out), true;   out.printIn(“Hello”);    }   )   Which statement at PointX on line 1 allows this code to compile and run?()

    • A、 Import java.io.PrintWriter;
    • B、 Include java.io.PrintWriter;
    • C、 Import java.io.OutputStreamWriter;
    • D、 Include java.io.OutputStreamWriter;
    • E、 No statement is needed.

    正确答案:A

  • 第21题:

    单选题
    在单一文件中import、class和package的正确出现顺序是()
    A

    package,import,class

    B

    class,import,package

    C

    import,package,class

    D

    package,class,import


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

  • 第22题:

    单选题
    下列有关类声明的代码片段,哪一项是正确的?()
    A

     import java.sql.*; package school; class Student{ }

    B

     package school; import java.sql.*; class Student{ }

    C

     package school; class Student{ } import java.sql.*;

    D

     package school; import java.sql.*;private String name; class Student{ }


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

  • 第23题:

    单选题
    下面关于#import和#include的描述正确的是()
    A

    #import是#include的替代指令,防止重复引用

    B

    #import和#include不可以混合使用

    C

    #import只用于引用Objective-C的文件,#include只用于引用C和C++的文件

    D

    #import和#include的使用效果完全相同


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