网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
单选题
final 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); } } 结果为:()
A
elm elm elm elm
B
tree elm elm elm
C
tree elm tree elm
D
编译失败
参考答案
参考解析
解析:
暂无解析
更多 “单选题final 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); } } 结果为:()A elm elm elm elmB tree elm elm elmC tree elm tree elmD 编译失败” 相关考题
考题
●Traversing a binary tree in preorder is equivalent to (68) .(68) A.Traversing the forest corresponding to the binary tree in root-first orderB.Traversing the forest corresponding to the binary tree in root-last orderC.Traversing the forest corresponding to the binary tree in breadth-first orderD.None of the above
考题
It is believed that the tradition of having a pine tree as a Christmas Tree comes from Germany.()
考题
finalclassTree{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);}}结果为:()A.elmelmelmelmB.treeelmelmelmC.treeelmtreeelmD.编译失败
考题
现有: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);}结果为:()
考题
阅读以下说明和C语言函数,将应填入(n)处的语句写在对应栏内。【说明】本程序利用非递归算法实现二叉树后序遍历。【函数】include<stdio.h>include<stdlib.h>typedef struct node{/*二叉树的结点数据结构类型*/char data;struct node *left;struct node *right;}BTREE;void SortTreelnsert(BTREE **tree, BTREE *s){if(*tree==NULL)*tree=s;elseif(s->data<(*tree)->data)SortTreelnsert((1),s);else if(s->data>=(*tree)->data)SortTreelnsert((2),s);}void TraversalTree(BTREE *tree){BTREE *stack[1 000],*p;int tag[1000],top=0;p=tree;do{while(p !=NULL){stack[++top]=p;(3);tag[top]=0; /*标记栈顶结点的左子树已进行过后序遍历*/}while(top>0(4))/*栈顶结点的右子树是否被后序遍历过*/{p=stack[top--];putchar(p->data);}if(top>0)/*对栈顶结点的右子树进行后序遍历*/{(5);tag[top]=1;}}while(top>0);}void PrintSortTree(BTREE *tree){if(tree !=NULL){printSortTree(tree->left);putchar(tree->data);pdntSortTree(tree->right);}}main(){BTREE *root=NULL, *node;char ch;ch=getchar();while(ch !=''){node=(BTREE*)malloc(sizeof(BTREE));node->data=ch;node->left=node->right=NULL;SortTreelnsert(root, node);ch=getchar();}PrintSortTree(root);putchar('\n');TraversalTree(root);}
考题
下面程序段的输出结果为 public class Test { public static void main(String args[]) { boolean a,b,c; a=(35); 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=falseB.a=true b=false b=true c=trueC.a=true b=true b=tree c=falseD.a=false b=false b=tree c=false
考题
Traversing a binary tree in preorder is equivalent to(68).A.Traversing the forest corresponding to the binary tree in root-first orderB.Traversing the forest corresponding to the binary tree in root-last orderC.Traversing the forest corresponding to the binary tree in breadth-first orderD.None of the above
考题
考虑如下代码: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" );elseSystem.out.println( "Oops" );}}则输出结果中有哪些?A.Pine B.Tree C.Forest D.Oops E.无输出
考题
Which command enhances the 802.1D convergence time on ports that are connected to hosts?()
A. spanning-tree backbonefastB. spanning-tree uplinkfastC. spanning-tree portfastD. spanning-tree cost512
考题
Which command enables RSTP on a switch?()
A. spanning-tree mode rapid-pvstB. spanning-tree uplinkfastC. spanning-tree backbonefastD. spanning-tree mode mst
考题
Which two of these statements correctly describe classic PIM-SM?()A、The IOS default is for a last-hop router to trigger a switch to the shortest path tree as soon as a new source is detected on the shared tree.B、The IOS default is for every one of the routers on the shared tree to trigger a switch to the shortest path tree as soon as a new source is detected on the shared tree.C、The default behavior of switching to the shortest path tree as soon as a new source is detected on the shared tree can be disabled by setting the value in the ip pim spt-threshold command to "infinity."D、The default behavior of switching to the shortest path tree as soon as a new source is detected on the shared tree can be disabled by setting the value in the ip pim spt-threshold command to "zero."
考题
What is the Cisco IOS default behavior for switching from the shared tree to the shortest path tree in PIM-SM operations?()A、immediately after receiving the first packet on the shared tree for a given (S,G)B、after receiving over 1 kb/s traffic onthe shared tree for a given (S,G)C、10 seconds after receiving the first packet on the shared tree for a given (S,G)D、30 seconds after receiving the first packet on the shared tree for a given (S,G)E、after receiving over 10 kb/s traffic onthe shared tree for a given (S,G)
考题
现有: 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) ;} 结果为:() A、 elm elm elm elmB、 tree elm elm elmC、 tree elm elm treeD、 tree elm tree elm
考题
Which command enables RSTP on a switch?()A、spanning-tree mode rapid-pvstB、spanning-tree uplinkfastC、spanning-tree backbonefastD、spanning-tree mode mst
考题
Which command enhances the 802.1D convergence time on ports that are connected to hosts?()A、spanning-tree backbonefastB、spanning-tree uplinkfastC、spanning-tree portfastD、spanning-tree cost512
考题
final 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); } } 结果为:() A、elm elm elm elmB、tree elm elm elmC、tree elm tree elmD、编译失败
考题
public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?() A、 The code will compile without changes.B、 The code will compile if public Tree() { Plant(); } is added to the Tree class.C、 The code will compile if public Plant() { Tree(); } is added to the Plant class.D、 The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E、 The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.
考题
import java.io.*; public class Forest implements Serializable { private Tree tree = new Tree(); public static void main(String [] args) { Forest f= new Forest(); try { FileOutputStream fs = new FileOutputStream(”Forest.ser”); ObjectOutputStream os = new ObjectOutputStream(fs); os.writeObject(f); os.close(); } catch (Exception ex) { ex.printStackTrace(); } } } class Tree { } What is the result?() A、 Compilation fails.B、 An exception is thrown at runtime.C、 An instance of Forest is serialized.D、 A instance of Forest and an instance of Tree are both serialized.
考题
单选题哪个命令可以在交换机启用RSTP? ()A
spanning-tree mode rapid-pvstB
spanning-tree uplinkfastC
spanning-tree backbonefastD
spanning-tree mode mst
考题
单选题Which spanning-tree command would cause a PortFast-enabled interface to lose its PortFast-operational status and disable BPDU filtering if it receives BPDUs?()A
spanning-tree guard rootB
spanning-tree portfast bpduguard defaultC
spanning-tree bpduguard enableD
spanning-tree bpdufilter enableE
spanning-tree portfast bpdufilter default
考题
单选题现有: 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) ;} 结果为:()A
elm elm elm elmB
tree elm elm elmC
tree elm elm treeD
tree elm tree elm
考题
单选题import java.io.*; public class Forest implements Serializable { private Tree tree = new Tree(); public static void main(String [] args) { Forest f= new Forest(); try { FileOutputStream fs = new FileOutputStream(”Forest.ser”); ObjectOutputStream os = new ObjectOutputStream(fs); os.writeObject(f); os.close(); } catch (Exception ex) { ex.printStackTrace(); } } } class Tree { } What is the result?()A
Compilation fails.B
An exception is thrown at runtime.C
An instance of Forest is serialized.D
A instance of Forest and an instance of Tree are both serialized.
考题
单选题public class Plant { private String name; public Plant(String name) { this.name = name; } public String getName() { return name; } } public class Tree extends Plant { public void growFruit() { } public void dropLeaves() { } } Which is true?()A
The code will compile without changes.B
The code will compile if public Tree() { Plant(); } is added to the Tree class.C
The code will compile if public Plant() { Tree(); } is added to the Plant class.D
The code will compile if public Plant() { this(”fern”); } is added to the Plant class.E
The code will compile if public Plant() { Plant(”fern”); } is added to the Plant class.
考题
单选题Which command enables RSTP on a switch?()A
spanning-tree mode rapid-pvstB
spanning-tree uplinkfastC
spanning-tree backbonefastD
spanning-tree mode mst
考题
单选题final 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); } } 结果为:()A
elm elm elm elmB
tree elm elm elmC
tree elm tree elmD
编译失败
考题
单选题What is the Cisco IOS default behavior for switching from the shared tree to the shortest path tree in PIM-SM operations?()A
immediately after receiving the first packet on the shared tree for a given (S,G)B
after receiving over 1 kb/s traffic onthe shared tree for a given (S,G)C
10 seconds after receiving the first packet on the shared tree for a given (S,G)D
30 seconds after receiving the first packet on the shared tree for a given (S,G)E
after receiving over 10 kb/s traffic onthe shared tree for a given (S,G)
热门标签
最新试卷