阅读下列利用递归来求n!的程序。 class FactorialTest{ static long Factorial(int n){//定义Factorial方法 if(n= =1) return l; else return n*Factorial{ }; } public static void main{String a[]}{ //main方法 int n=8: System.out.println{n+"!="+Factorial (n)}; } } 为保证程序正确运行,在下画线处应该填入的参数是()。
A. n-1
B. n-2
C. n
D. n+1
查看答案
下列各词语中加点字的读音全都不相同拘一项是 () 。
A. 喑哑 黑暗 韵脚 黯然失色
B. 调动 稠密 雕刻 民生凋敝
C. 稍微 讥诮 末梢 形销骨立
D. 租赁 狙击 阻止 神情沮丧
下面程序段的输出结果是()。 public class Test{ public static void main(String args[]){ int X,y; x=(int)Math.sqrt(5)/2+(int)Math.random*5/2; y=(int)Math.sqrt(3)/2+(int)Math.random*3/2; if(x>v) System.OUt.println("x>y"); elseif(x= =y) System.out.println("x=Y"); else System.out.println("x<y"): } }
A. x>y
B. x=Y
C. x<y
D. 编译错误
为了支持压栈线程与弹栈线程之间的交互与同步,在程序的下画线处依次填入的语句是()。 public class IntStack{ private int idx=0; private int[]data=new int[8]; public void push(int i){ data[idx]=i: idx++; … … }
A. synchronized notify
B. synchronized this.wait
C. synchronized this.notify
D. Serializable sleep
评估某非标准设备,其主材(钢材)净消耗量为15吨,估价时该主材不含税的市场为3 600元/吨,设备所需主要外购件不含税费用为43 610元,综合税金率为l8.7%,主材利用率为85%,成本主材费率为60%,成本利润率为l8%,设计费率为20%,产量4台。则该设重置成本为()元。
A. 120 893
B. 198 275
C. 227 824
D. 235 421