给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } }编译时将产生错误)是正确的。()
相似题目
-
给出下列java源代码: //Point x Public class Interesting{} 在源代码//point x处添加()能符合java语法
-
下面代码的运行结果为:( )import java.io.*;import java.util.*;public class foo{public static void main (String[] args){String s;System.out.println(s= + s);}}
-
给出下列代码,如何使成员变量m 被方法fun()直接访问?class Test{private int m;public static void fun(){...}}
-
给出下面代码: public class Parent{int change(){ }} class Child extends Parent{} 可加入类Child中的方法是( )。
-
读代码:public class ExceptionTest {class TestException extends Exception {}public void runTest () throws TestException {}public void test () /* Point X*/ {runTest ();}}第4行//point X 位置, 加哪行代码能让代码可编译
-
给出下面的代码段:( )public class Base{int w, x, y, z;public Base(int a, int b){x=a; y=b;}public Base(int a, int b, int c, int d){//assignment x=a, y=bw=d;z=c;}}在代码说明//assignment x=a, y=b处写下如下哪几个代码是正确的?()
-
执行下面代码,下面描述正确的是( ) public class Person{ static int arr[]=new int[10]; public static void main(String a[]){ System.out.println(arr[1]); } }
-
请看如下代码 class Person {private int a;public int change(int m){return m;}}public class Teacher extends Person{public int b;public static void main(String arg[]){Person p = new Person();Teacher t = new Teacher();int i;// point x}}下面哪些放在// point x?行是正确的?
-
给出下面的程序代码:public class X4_1_3 { private float a; public static void m ()访问
-
下面这段代码编译和运行时会发生什么情况()。 abstract class MineBase { abstract void amethod(); static int i; } public class Mine extends MineBase { public static void main(String[] args) { int[ ] ar = new int[5]; for(int i=0; i < ar.length; i++) System.out.println(ar[i]); } }
-
给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } } 那个语句是正确的()。
-
给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } } 编译时正确,运行时将产生错误是正确的。()
-
给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } }()是正确的。
-
给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } } 哪个语句是错误的()。
-
给出下面代码: public class Person{ static int arr[] = new int[10];public static void main(String a[]) {System.out.println(arr[1]); } } 哪个语句是正确的()。
-
代码三: public class Test03 { public static void main(); } }
-
以下代码可以编译通过 public class Test01 { public static void main(); } }
-
用下面那个代码代替程序标注的【代码】会导致编译错误?public class E{public static void main(String args[]){int m=10,n=0;if(【代码】){System.out.println(“Hello”);}}}()
-
给定如下代码,下面可以作为该类的构造函数的是()public class Test {}
-
代码四: public class Test04 { public static void main(); n--; } } }
-
给出下面代码:public class test{static int a[] = new a[10];public static void main(){System.out.println();}}下列选项正确的是()
-
给出下面一段程序,选择运行结果() public class X{ public static void main(String[] args){ String names[] = new String[5]; for(int x=0; x<args.length; x++) names[x]=args[x]; System.out.println(names[2]); } } 命令行执行:java X 结果是下面哪一个?
-
3、阅读下面代码,写出输出结果: public class A { public void fun1(int n) { Console.WriteLine("{0}x2={1}", n, 2 * n); } public void fun2(int n) { Console.WriteLine("{0}x3={1}", n, 3 * n); } } public delegate void mydelegate(int n) public class Test { public static event mydelegate p; static void Main() { A a = new A(); p += new mydelegate(a.fun1); p(1); } }
-
20、下面代码的运行结果为:() public class Rectangle {public int width = 3;public int height = 4;public int area() {return width * height; }public static void main(String args[]) { Rectangle rectangle = new Rectangle(); rectangle.height = 5; System.out.println(rectangle.area()); }}
推荐题目
- 多品种轮番生产的最小生产费用计划是将计划期划分为几个长度相等的循环流程,在每个循环流程中实现多品种轮番生产,以循环流程长度作为因变量,列出生产费用函数,求出最小费用循环流程,最后从该流程长度推算出各品种的批量。()
- 食品法典委员会的缩写是()
- 下列精子叙述哪项正确()
- 下列钢材中属于合金钢的是()。
- 关于特别授权,一般可针对符合一定条件的以下哪些对象进行()。
- 建设工程施工合同无效,但建设工程经竣工验收合格,承包人请求参照合同约定支付工程价款的,()。
- 120~160km/h运行区段,锚段长度在800m及以上的承力索接头的数量限界值不得超过()。
- 电信企业市场营销作为一种活动,有如下4项基本功能:发现和了解消费者的需求、指导企业决策、满足消费者的需求()。
- 代理调拨的回笼天数()
- 15、未来没有创业的计划,也不打算参与创业,所以学习创业没有什么用处。