SCJP程序员认证考试

单选题Which code should be inserted at line 1 of Demo.java to compile and run Demo toprint "pizzapizza"?()Aimport utils.*;Bstatic import utils.*;Cimport utils.Repetition.*;Dstatic import utils.Repetition.*;Eimport utils.Repetition.twice();Fimport static util

题目
单选题
Which code should be inserted at line 1 of Demo.java to compile and run Demo toprint "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;

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第1题:

There are three static routes in the routing table that need to be announced to your OSPF peers. Which method is used to accomplish this?()

A. Apply an import policy to OSPF that injects the static routes into OSPF

B. Apply an import policy to the static routes that injects the static routes into OSPF

C. Apply an export policy to the static routes that injects the static routes into OSPF

D. Apply an export policy to OSPF that injects the static routes into OSPF


参考答案:D

第2题:

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

第3题:

Given two files, GrizzlyBear.java and Salmon.java:If both classes are in the correct directories for their packages, and the Mammal class correctly defines the findSalmon() method, which change allows this code to compile?()

A.add import animals.mammals.*; at line 2 in Salmon.java

B.add import animals.fish.*; at line 2 in GrizzlyBear.java

C.add import animals.fish.Salmon.*; at line 2 in GrizzlyBear.java

D.add import animals.mammals.GrizzlyBear.*; at line 2 in Salmon.java


参考答案:B

第4题:

//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

第5题:

Your routing table contains four static routes which you need to redistribute to your OSPF peers. Which method would accomplish this?()

  • A、Apply an import policy to OSPF; this will import the static routes into OSPF
  • B、Apply an export policy to protocol "static"; this will export the routes to other protocols.
  • C、Apply an import policy to the forwarding table; this will import the routes, allowing them to be forwarded to OSPF neighbors.
  • D、Apply an export policy to OSPF; this will export the static routes to your OSPF neighbors.

正确答案:D

第6题:

Your routing table contains four static routes which you need to redistribute to your OSPF peers. Which method would accomplish this?()

A.Apply an import policy to OSPF; this will import the static routes into OSPF

B.Apply an export policy to protocol "static"; this will export the routes to other protocols.

C.Apply an import policy to the forwarding table; this will import the routes, allowing them to be forwarded to OSPF neighbors.

D.Apply an export policy to OSPF; this will export the static routes to your OSPF neighbors.


参考答案:D

第7题:

There are three static routes in the routing table that need to be announced to your OSPF peers. Which method is used to accomplish this?()

  • A、Apply an import policy to OSPF that injects the static routes into OSPF
  • B、Apply an import policy to the static routes that injects the static routes into OSPF
  • C、Apply an export policy to the static routes that injects the static routes into OSPF
  • D、Apply an export policy to OSPF that injects the static routes into OSPF

正确答案:D

第8题:

Given a class Repetition: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

第9题:

You are writing a JSP that includes scriptlet code to declare a List variable and initializes that variable to anArrayList object. Which two JSP code snippets can you use to import these list types?()

  • A、<%! import java.util.*; %>
  • B、<%! import java.util.List;import java.util.ArrayList; %>
  • C、<%@ page import=’java.util.List’import=’java.util.ArrayList’ %>
  • D、<%@ import types=’java.util.List’types=’java.util.ArrayList’ %>
  • E、<%@ page import=’java.util.List,java.util.ArrayList’ %>
  • F、<%@ import types=’java.util.List,java.util.ArrayList’ %>

正确答案:C,E

第10题:

package sun.scjp;  public enum Color { RED, GREEN, BLUE }  package sun.beta;  // insert code here  public class Beta {  Color g = GREEN;  public static void main( String[] argv)  { System.out.println( GREEN); }  }  The class Beta and the enum Color are in different packages.  Which two code fragments, inserted individually at line 2 of the Beta declaration, will allow this code to compile?()

  • A、 import sun.scjp.Color.*;
  • B、 import static sun.scjp.Color.*;
  • C、 import sun.scjp.Color; import static sun.scjp.Color.*;
  • D、 import sun.scjp.*; import static sun.scjp.Color.*;
  • E、 import sun.scjp.Color; import static sun.scjp.Color.GREEN;

正确答案:C,E

更多相关问题