考试网 >> IT认证 >> JAVA >> JAVA题库 >> JAVA题库:格林模拟试题三(下)

JAVA题库:格林模拟试题三(下)

发布时间:2006-06-28 10:52     点击:
分页:上一页  1 2 3 4 [5] 6 7 8  下一页

2) To be overridden a method only needs the same name and parameter types

3) To be overridden a method must have the same name, parameter and return types

4) An overridden method must have the same name, parameter names and parameter types


Question 47)

What will happen when you attempt to compile and run the following code?

class Base{
Base(){System.out.println("Base");}
}public class Checket extends Base{
public static void main(String argv[]){Checket c = new Checket();super();}Checket(){System.out.println("Checket");  }       
}

1) Compile time error

2) Checket followed by Base

3) Base followed by Checket

4) runtime error


Question 48)

Which of the following statements are true?

1) Static methods cannot be overriden to be non static

2) Static methods cannot be declared as private

3) Private methods cannot be overloaded

4) An overloaded method cannot throw exceptions not checked in the base class


Question 49)

Which of the following statements are true?

1) The automatic garbage collection of the JVM prevents programs from ever running out of memory

2) A program can suggest that garbage collection be performed but not force it

3) Garbage collection is platform independent

4) An object becomes eligible for garbage collection when all references denoting it are set to null.


Question 50)

Given the following code

public class Sytch{
int x=2000;
public static void main(String argv[]){System.out.println("Ms "+argv[1]+"Please pay $"+x);}}
What will happen if you attempt to compile and run this code with the command line
java Sytch Jones Diggle

1) Compilation and output of Ms Diggle Please pay $2000

分页:上一页  1 2 3 4 [5] 6 7 8  下一页
版权申明:未经书面授权请勿转载本站信息!!作品版权归所属媒体与作者所有!!
发表评论: 匿名发表 用户名: 查看评论
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容
本站提醒:不要进行人身攻击。谢谢配合。
在本站搜索相关信息
2003-2005 Ksw123.com All Rights Reserved. - TOP
Copyright © 2006 Ksw123.com. All rights reserved.中国考题网 版权所有