1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (short)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?()
相似题目
-
1.public class Test { 2.public static void main (String args[]) { 3.class Foo { 4.public int i = 3; 5.} 6.Object o = (Object) new Foo(); 7.Foo foo = (Foo)o; 8.System.out.printIn(foo. i); 9. } 10.} What is the result?()
-
1. public class A { 2. void A() { 3. System.out.println(“Class A”); 4. } 5. public static void main(String[] args) { 6. new A(); 7. } 8. } What is the result?()
-
1. public class returnIt ( 2. returnType methodA(byte x, double y) ( 3. return (short) x/y * 2; 4. ) 5. ) What is the valid returnType for methodA in line 2?()
-
1. public class ReturnIt { 2. return Type methodA(byte x, double y) { 3. return (long)x / y * 2; 4. } 5. } What is the narrowest valid returnType for methodA in line2?()
-
public class TestString 1 { public static void main(String[] args) { String str = “420”; str += 42; System.out.print(str); } } What is the output?()
-
public class test { public static void main(String [] a) { assert a.length == 1; } } Which two will produce an AssertionError?()
-
class Top { static int x = 1; public Top(int y) { x *= 3; } } class Middle extends Top { public Middle() { x += 1; } public static void main(String [] args) { Middle m = new Middle(); System.out.println(x); } } 结果为:()
-
Given: 1. public class ConstOver { 2. public constOver(int x, int y, int z) { 3. } 4. } Which two overload the ConstOver Constructor?()
-
现有2 个文件: 1. package x; 2. public class X { 3. public static void doX() { System.out.print("doX "); } 4. } 和: 1. class Find { 2. public static void main(String [] args) { 3. //insert code here 4. } 5. } 哪两行分别插入到类Find 的第3 行将编译并产生输出“doX”? ()
-
1. class SuperClass { 2. public a geta() { 3. return new a(); 4. } 5. } 6. class SubClass extends SuperClass { 7. public b geta() { 8. return new b(); 9. } 10. } Which is true?()
-
1. public class A { 2. public void doit() { 3. } 4. public String doit() { 5. return “a”; 6. } 7. public double doit(int x) { 8. return 1.0; 9. } 10.} What is the result?()
-
1. class Super { 2. public float getNum() { return 3.0f; } 3. } 4. 5. public class Sub extends Super { 6. 7. } Which method, placed at line6, causes compilation to fail?()
-
执行以下代码,输出结果的结果是? () public class Test{ public String[] ss = new String[5]; public static void main(String[] args){ System.out.println(ss[1]); } }
-
class A { public byte getNumber() { return 1; } } class B extends A { public short getNumber() { return 2; } public static void main(String args[]) { B b = new B(); System.out.println(b.getNumber()); } } What is the result?()
-
设有如下代码public class Test6{int attr[] = {1,2,3};public static void main ( String args[] ) {System.out.println(attr[0]);}}哪个叙述为真?
-
1.public class Test1{ 2. public float aMethod(float a,float b){ } 3. 4,} 将以下哪种方法差如行 3 是不合法的( )
-
智慧职教: 程序的执行结果是() public class Test { public static void main(String [] args){ System.out.println(“”+'a'+1); } }
-
分析如下所示的Java代码,则选项中的说法正确的是( )。 class Parent{ public String name; public Parent(String pName){ this.name = pName; } } public class Test extends Parent { //1 public Test(String Name){ //2 name=\hello
-
给出下面的程序代码:public class X4_1_3 { private float a; public static void m ()访问
-
有如下程序:include<iostream>using namespace std;class GA{public:virtual int f(){return 1
-
关于下面的程序Test.java说法正确的是()。public class Test {String x="1";int y;
-
1、读下面的程序,写出输出结果include <iostream> using namespace std; class A { public: A(int i) {cout<<"constructing A "<<i<<endl;} }; class B { public: B(int j) {cout<<"constructing B "<<j<<endl;} }; class C: public A, public B { public: C(int a, int b, int c, int d): A(a), mB(d), mA(c),B(b) { } private: B mB; A mA; }; int main() { C obj(1,2,3,4); return 0; }
-
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); } }
-
下列代码中,将引起一个编译错误的行是 1) public class Test 2) int m,n; 3) public Test() 4) public Test(int
推荐题目
- 对国有不可移动文物进行(),必须遵守不改变文物原状的原则。
- 电棒烫需要哪些工具?
- 按沥青混合料压实后空隙率的大小分类,沥青混合料可以分为:()
- 当机长发布到达安全高度指令后,乘务员指导旅客将用过的氧气面罩应放入座椅前口袋内,旅客不得再拉动氧气面罩及折叠氧气面罩。
- 林木落叶期,全树和单树有多少以上的树叶正常脱落。()
- 银团贷款充分地发挥了金融的整体功能,更好地为企业特别是()提供融资服务。
- 需要是()。
- http://image.zhihuishu.com/zhs/onlineexam/ueditor/201707/d96b43657e0944c48296c840a3a8a900.png
- 博弈均衡包括()。
- 学习型组织的五项修炼中不包括系统思考()