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 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?()
-
1. public class OuterClass { 2. private double d1 = 1.0; 3. // insert code here 4. } Which two are valid if inserted at line 3?()
-
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?()
-
1.public class Test{ 2.int x=12; 3.public void method(intx){ 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?()
-
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 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 Conditional {2. public static void main(String args [] ) {3. int x = 4;4. System.out.println( \value is \ +5. ((x > 4) ? 99.99 : 9));6. }7. }
-
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是不合法的。( )
-
分析如下所示的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(); } }
推荐题目
- 真菌生活史中有些只有有性阶段。
- ()之日起泥浆工开始坐岗。
- 育龄妇女,经量过多()
- 哥伦布的故事――把煮熟的鸡蛋立起来――属于哪类思维()。
- 肝脏是人体最大的实质性器官,其重量约()
- 患者女性,45岁,体检时于心尖区听诊,可闻及第一心音亢进及舒张期附加音,超声显示左房内可探及一椭圆形略高回声团,舒张期摆向二尖瓣口,收缩期回到左心房,并于二尖瓣口可录及到舒张期的射流频谱,流速2.1m/s,可能的诊断为()。
- 厂高变冷却器投自动时油温多少℃时启动冷却风扇?
- 求职中的“支撑点”就是:
- 定义一个排序的子过程,程序运行后,单击窗体,随机产生0~100之间的10个整数赋给一个一维数组,然后调用此子过程将一维数组中的数据按照从大到小的顺序进行排序,最后在窗体上输出排序前及排序后的数。 保存工程和窗体,窗体文件名为:昵称-7-3.frm;工程名为:昵称-7-3.vbp。将工程文件和窗体文件压缩成:昵称-7-3.rar,以附件形式提交。
- 分配抄表任务的抄表册中存在的用户状态类型有()