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
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
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.
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
|
您将承担一切因您的行为、言论而直接或间接导致的民事或刑事法律责任
留言板管理人员有权保留或删除其管辖留言中的任意内容 本站提醒:不要进行人身攻击。谢谢配合。 |