网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
现有:
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);}
结果为:()
参考答案
更多 “ 现有: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);}结果为:() ” 相关考题
考题
importjava.io.*;publicclassForestimplementsSerializable{privateTreetree=newTree();publicstaticvoidmain(String[]args){Forestf=newForest();try{FileOutputStreamfs=newFileOutputStream(”Forest.ser”);ObjectOutputStreamos=newObjectOutputStream(fs);os.writeObject(f);os.close();}catch(Exceptionex){ex.printStackTrace();}}}classTree{}Whatistheresult?()A.Compilationfails.B.Anexceptionisthrownatruntime.C.AninstanceofForestisserialized.D.AinstanceofForestandaninstanceofTreearebothserialized.
考题
考虑如下代码: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.无输出
考题
【单选题】下列情况中,()属于第一种无形磨损。A.出现了效率更高的同种设备,使现有设备贬值B.由于生产率提高,生产同种设备的社会必要劳动减少,使现有设备贬值C.现有设备生产精度下降,使现有设备贬值D.现有设备生产效率下降,使现有设备贬值
热门标签
最新试卷