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 test ( 2.public static void main (String args[]) { 3.int i = 0xFFFFFFF1; 4.int j = ~i; 5. 6.} 7.) What is the decimal value of j at line 5?()
1. public class Test { 2. int x= 12; 3. public void method(int x) { 4. x+=x; 5. System.out.println(x); 6. } 7. } Given: 34. Test t = new Test(); 35. t.method(5); What is the output from line 5 of the Test class?()
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?()
Given: 1. public class Method Over { 2. public void set Var (int a, int b, float c) { 3. } 4. } Which two overload the set Var method()?
1. public class Test { 2. public static void main (String args) { 3. unsigned byte b = 0; 4. b--; 5. 6. } 7. } What is the value of b at line 5?()
public class TestString 1 { public static void main(String[] args) { String str = “420”; str += 42; System.out.print(str); } } What is the output?()
1. public class Test { 2. public static void main (String []args) { 3. unsigned byte b = 0; 4. b--; 5. 6. } 7. } What is the value of b at line 5?()
Given: 1. public interface Foo { 2. int k = 4: 3. } Which three are equivalent to line 2?()
Given 1. public class Foo { 2. public static void main (String [] args) } 3. try { return;} 4. finally { Syste.out.printIn (“Finally”);} 5. } 6. } What is the result()?
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?()
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. public class test ( 2. public static void main(string args[]) { 3. int 1= 0; 4. while (i) { 5. if (i==4) { 6. break; 7. } 8. ++i; 9. } 10. 11. } 12. ) What is the value of i at line 10?()
类Test1定义如下:1.public class Test1{2. public float aMethod(float a,float b){ }3.4.}将以下哪种方法插入行3是不合法的。
1.public class Test1{ 2. public float aMethod(float a,float b){ } 3. 4,} 将以下哪种方法差如行 3 是不合法的( )
题目:1. public class test (2. public static void main (String args[]) {3. int i = 0xFFFFFFF1;4. int j = ~i;5.6. }7. )程序运行到第5行时,j的值为多少?( )
类Test1定义如下: 1. public class Test1{ 2. public float aMethod(float a, float b){ } 3. 4. } 将以下哪种方法插入行3是不合法的。( )
读代码:1. public interface Foo{2.int k = 4;3. }Which three are equivalent to line 2? (Choose Three)
分析如下所示的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
您可以在第几行的“?”位置上添加static关键字? 1 public class Test { 2 private int age; 3 4 public ? int square(int n) { 5 return n * n; 6 } 7 8 public ? int getAge() { 9 } 10}
下列代码中,将引起一个编译错误的行是 1) public class Test 2) int m,n; 3) public Test() 4) public Test(int
10、已知有下列类的说明,则下列哪个语句是正确的?() public class Test { private float f = 1.0f; int m = 12; static int n = 1; public static void main(String arg[]) { Test t = new Test(); } }
对于下列代码,下列哪个叙述是正确的()? class A{ public int i=0; A(int m){ i=1; } } public class B extends A{ B(int m){ i=2; } public static void main(String args[]){ B b=new B(100); System.out.println(b.i); //【代码】 } }