现有: class Tree { private static String tree = "tree "; String getTree () { return tree; } } class Elm extends Tree { private static String tree = "elm "; public static void main (String [] args) { new Elm() .go (new Tree()) ; } } void go (Tree t) { String s = t.getTree () +Elm.tree + tree + (new Elm() .getTree ()) ; System.out.println (s) ;} 结果为:()
第1题:
现有两个类A,B,以下描述中表示B继承自A的是 ( )
A.class A extends B
B.class B implements A
C.class A implements B
D.class B extends A
第2题:
考虑如下代码:
class Tree{}
class Pine extends Tree{}
class Oak extends Tree{}
public class Forest {
public static void main( String[] args ) {
Tree tree = new Pine();
if( tree instanceof Pine )
System.out.println( "Pine" );
if( tree instanceof Tree )
System.out.println( "Tree" );
if( tree instanceof Oak )
System.out.println( "Oak" );
else
System.out.println( "Oops" );
}
}
则输出结果中有哪些?
A.Pine B.Tree C.Forest D.Oops E.无输出
第3题:
A.packagey;
B.packagecom;
C.importcom.x.*;
D.importcom.x.y.*
第4题:
Draw a labeled constituent structure tree diagram for each of the following sentences: 1) The student likes the new linguistics professor. 2) John suggested Mary take the linguistics class.
1)The student likes the new linguistics professor.
2)John suggested (that) Mary take the linguistics class.
略
第5题:
A. spanning-tree mode rapid-pvst
B. spanning-tree uplinkfast
C. spanning-tree backbonefast
D. spanning-tree mode mst
第6题:
下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(3<5); b=(a==true); System.out.println(”a=”+a+”b=+b) ; c=(b==false); System.out.printhln(”b=”+b+”c=”+c) ; } }
A.a=true b=false b=true c=false
B.a=true b=false b=true c=true
C.a=true b=true b=tree c=false
D.a=false b=false b=tree c=false
第7题:
A. spanning-tree backbonefast
B. spanning-tree uplinkfast
C. spanning-tree portfast
D. spanning-tree cost512
第8题:
现有:
classTree{
privatestaticStringtree="tree";
StringgetTree(){returntree;}
}
classElmextendsTree{
privatestaticStringtree="elm";
publicstaticvoidmain(String[]args){
newElm().go(newTree());
}
}
voidgo(Treet){
Strings=t.getTree()+Elm.tree+tree+(newElm().getTree());
System.out.println(s);}
结果为:()
第9题:
第10题:
Which two of these statements correctly describe classic PIM-SM?()