【单选题】【消耗次数:1】
main方法是Java应用程序执行的入口点,关于main方法的方法头以下哪项是合法的?( )
public static void main()
public static void main( String[] args )
public static int main(String [] arg )
public void main(String arg[] )
参考答案:
复制
纠错
相关题目
【单选题】 编译下面源程序会得到哪些文件( )? class A1{ } class A2{ } public class B{ public static void main(String[] args) { } }
①  只有B.class 文件
②  只有 A1.class 和 A2.class 文件
③  编译不成功
④  A1.class、A2.class 和B.class 文件
【单选题】 下列程序执行的结果是( ) 。 public class X7_1_6 { public static void main(String[] args) { try{ return; } finally{ System.out.println(Finally); } } }
①  程序正常运行,但不输出任何结果
②  程序正常运行,并输出 Finally
③  编译通过,但运行时出现异常
④  因为没有 catch 子句,因此不能通过编译
【单选题】 阅读以下代码: import java.io.*; import java.util.*; public class foo{ public static void main (String[] args){ String s; System.out.println(s= + s); } } 输出结果应该是:( )
①  代码得到编译,并输出“s=”
②  代码得到编译,并输出“s=null”
③  由于String s没有初始化,代码不能编译通过
④  代码得到编译,但捕获到 NullPointException异常
【单选题】 编译运行以下程序后,关于输出结果的说明正确的是 ( ) public class Conditional{ public static void main(String args[ ]){ int x=4; System.out.println(“value is “+ ((x>4) ? 9.9:9)); } }
①  输出结果为:value is 99.9
②  输出结果为:value is 9
③  输出结果为:value is 9.0
④  编译错误
【单选题】 以下程序的运行结果是:( ) public class Increment{ public static void main(String args[]){ int c; c = 2; System.out.println(@@; System.out.println(c++); System.out.println(@@; } }
①  2 2 2
②  2 3 3
③  2 2 3
④  3 4 4
【单选题】 已知有下面类的说明: public class X5_1_1 extends x{ private float f =10.6f; int i=16; static int si=10; public static void main(String[] args) { X5_1_1 x=new } } X5_1_1(); 在 main()方法中,下面哪条语句的用法是正确的?( )
①  x.f
②  this.si
③  X5_1_1.i
④  X5_1_1.f
【单选题】 运行下面程序时,会产生什么异常?( ) public class X7_1_4 { public static void main(String[] args) { int x = 0; int y = 5/x; int[] z = { 1,2,3,4 } ; int p = z[4]; } }
①  ArithmeticException
②  NumberFormatException
③  ArrayIndexOutOfBoundsException
④  IOException
【单选题】 运行下面程序时,会产生什么异常?( ) public class X7_1_5 { public static void main(String[] args) { int[] z = { 1,2,3,4 } ; int p = z[4]; int x = 0; int y = 5/x; } }
①  ArithmeticException
②  NumberFormatException
③  ArrayIndexOutOfBoundsException
④  IOException
【单选题】 下列程序的运行结果是( ) 。 public class X5_1_2 extends x{ int ab() { static int aa=10; aa++; System.out.println(aa); } public static void main(String[] args) { X5_1_2 x=new X5_1_2(); x.ab(); } }
①  10
②  11
③  编译错误
④  运行成功,但不输出
【单选题】 关于以下application的说明,正确的是( ) 1. class StaticStuff 2. { 3. static int x=10; 4. static { x+=5;} 5. public static void main(String args[ ]) 6. { 7. System.out.println(“x=” + x); 8. } 9. static { x/=3;} 10. }
①  4行与9行不能通过编译,因为缺少方法名和返回类型
②  9行不能通过编译,因为只能有一个静态初始化器
③  编译通过,执行结果为:x=5
④  编译通过,执行结果为:x=3
随机题目
【单选题】 细小而分散的称为()
①  缩孔
②  缩松
③  放空
④  放松
【单选题】 是金属塑性加工的基本方法之一
①  冲压
②  淬火
③  冷却
④  放松
【单选题】 钢中合金元素含量越多,合金越复杂,变形抗力越
① 
② 
【多选题】 影响焊接性的因素
①  材料因素
②  结构因素
③  工艺因素
④  使用因素
【单选题】 主运动的速度最高,消耗的功率
①  最小
②  最低
③  最大
④  最高
【单选题】 质量较
① 
② 
③  一般
【多选题】 金属的可锻性常用金属的什么衡量
①  塑性
②  变形抗力
【多选题】 图示圆锥齿轮铸件,齿面质量要求较高。材料HT350,小批生产。最佳浇注位置及分型面的方案是:()<imgsrc="http://wljy.whut.edu.cn:80/uploadfiles/kindeditorAttached/image/20191204/20191204093905_400.png"alt=""/>
①  方案Ⅰ
②  方案Ⅱ
③  方案Ⅲ
④  方案四
【单选题】 一台他励直流发电机的输入功率<imgwidth="40"height="59"src="http://wljy.whut.edu.cn:80/uploadfiles/word/DJYTD.files/DJYTD39625.png">等于()
①  <imgwidth="148"height="60"src="http://wljy.whut.edu.cn:80/uploadfiles/word/DJYTD.files/DJYTD39741.png">
②  <imgwidth="157"height="99"src="http://wljy.whut.edu.cn:80/uploadfiles/word/DJYTD.files/DJYTD39862.png">
③  <imgwidth="103"height="60"src="http://wljy.whut.edu.cn:80/uploadfiles/word/DJYTD.files/DJYTD39983.png">
【单选题】 下图所示网络中,f点发生三相短路时,关于短路点右侧网络中的电流正确的说法是()。<imgsrc="http://wljy.whut.edu.cn:80/uploadfiles/kindeditorAttached/image/20191205/20191205075635_277.png"alt=""/>
①  不存在电流
②  过渡过程中存在电流
③  电流始终存在