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); } }
推荐题目
- 市净率
- 链篦机-回转窑是一种联合机组,主体设备由()、()和()三个独立的部分组成。
- 有关肾细胞癌治疗的叙述错误的是()
- 下列对于内伤发热的叙述正确的有()
- 第23路信令在什么位置?
- 患者,男,40岁。咳嗽气促,咳痰量多,痰质黏稠而黄,咯吐不爽,胸胁胀满,面赤身热,口干,舌红苔黄腻,脉滑数。治疗应首选()。
- 关于锝气体的说法()。
- 下列哪项不是脑瘫常见的临床表现()
- 根据支付结算的有关规定,托收承付的付款人,有正当理由的,可以向银行提出全部或部分拒绝付款。下列选项中,托收承付的付款人可以拒绝付款的款项有()
- 电饭锅萨达干啥都干,电饭锅十多个是大干啥都干,电饭锅第三方该死的发个,电饭锅是电饭锅水电费个