public class WhileFoo { public static void main (String []args) { int x= 1, y = 6; while (y--) {x--;} system.out.printIn(“x=” + x “y =” + y); } } What is the result?()
相似题目
-
public class SomeException { } Class a: public class a { public void doSomething() { } } Class b: public class b extends a { public void doSomething() throws SomeException { } } Which is true about the two classes?()
-
package geometry; public class Hypotenuse { public InnerTriangle it = new InnerTriangle(); class InnerTriangle { public int base; public int height; } } Which is true about the class of an object that can reference the variable base? ()
-
public class Pass{ public static void main(String[]args){ int x=5; Pass p=new Pass(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()
-
1. public class Person { 2. private String name; 3. public Person(String name) { this.name = name; } 4. public boolean equals(Person p) { 5. return p.name.equals(this.name); 6. } 7. } Which is true?()
-
public class Pass { public static void main(String [1 args) { int x 5; Pass p = new Pass(); p.doStuff(x); System.out.print(” main x = “+ x); } void doStuff(int x) { System.out.print(” doStuff x = “+ x++); } } What is the result?()
-
package foo; public class Outer { public static class Inner { } } Which statement is true?()
-
package foo; public class Outer ( public static class Inner ( ) ) Which statement is true?()
-
现有: public class Pet() public class Cat extends Pet{) 执行代码 Cat c- new Cat(); Pet p= (Pet)c; 后下列哪项是正确的?()
-
public class WhileFoo { public static void main (String args) { int x= 1, y = 6; while (y--) {x--;} system.out.printIn(“x=” + x “y =” + y); } } What is the result?()
-
public class X { public X aMethod() { return this;} } public class Y extends X { } Which two methods can be added to the definition of class Y?()
-
现有: public class Pet() public class Cat extends Pet{) 执行代码 Cat c- new Cat(); Pet p= (Pet)c; 后下列哪项是正确的?()
-
public class Team extends java.util.LinkedList { public void addPlayer(Player p) { add(p); } public void compete(Team opponent) { /* more code here */ } } class Player { /* more code here */ } Which two are true?()
-
Given the command line java Pass2 and: public class Pass2{ public void main(String[]args){ int x=6; Pass2 p=new Pass2(); p.doStuff(x); System.out.print("mainx="+x); } void doStuff(intx){ System.out.print("doStuffx="+x++); } } What is the result?()
-
给定JAVA代码,如下:Class Parent{public void count() {System.out.println(10%3) ;}}public class Test extends Parent{public void count() {System.out.println(10/3) ;}public static void main(Stringargs[]) {Parent p = new Test() ;p.count() ;}}运行编译后,输出结果是()。
-
类MyClass的定义如下:class MyClass{ public:MyClass(){ value = 0;}SetVariable(inti) { value = i; }private:int value;}则对下列语句序列:MyClass*p,my; p=&my;正确的描述是( )。
-
运行下面程序时,会产生什么异常?( )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
-
请看如下代码 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?行是正确的?
-
下面程序输出的结果为()。 inClUde”iostream.h” Class A {public: A(){cout<<“CLASS A”<<endl;} ~A()<)}; class B:public A {public: B(){cout<<”CLASSB”<<endl;} ~B(){}}; void main() {A*p; p=new B; B *q; q=new B;}
-
运行下面程序时,会产生什么异常?() 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 = p/x; } }
-
已知定义public class Employee public class Manager extends Employee public class Contr已知定义public class Employee public class Manager extends Employee public class Contractor extends Employee Employee e=new Employee()
-
有如下程序:include<iostream>using namespace std;class A {public:A(){cout<<"A";}};classB{p
-
对于类定义:class A{public:virtual void func1(){}void func2(){}};class B:public A{public:
-
某 Java源文件代码如下: public class A { int a; } class B { int b; } class C { public static void main()
-
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); } }
推荐题目
- 初孕妇28岁,妊娠37周,诉近日恶心、呕吐、乏力,肝区叩击痛,胎心150次/分,血清ALT升高,HBsAg(+)。对该孕妇治疗护理错误的是()。
- 肾病综合征包括_____、_____、_____、_____。
- 当合成塔空速提高时,()。
- 简述污染物效应。
- 汤某女,40岁,两天来表现食已即吐,呕吐酸苦热臭,口臭干渴,苔黄厚腻,脉滑数病机为()。
- 就经营决策的类型而言,企业生产作业计划决策、库存决策等属于()。
- 制定《反间谍法》的法律依据是()
- 在仪表进近图上,一般用兰色表示:().
- 医疗机构制剂使用过程中发现的不良反应病例记录,有关检验、检查报告、原始记录应保存
- 绝缘手套主要用于操作()压电力设备时佩戴