java 将日期转化为格林时间|JAVA题库:格林模拟试题二(上)(1)

JAVA认证试题集锦 2021-07-16 网络整理 可可

【shitiku.jxxyjl.com--JAVA认证试题集锦】

question 1)

what will happen when you attempt to compile and run this code

abstract class base{
abstract public void myfunc();
public void another(){
system.out.println("another method");
}
}

public class abs extends base{
public static void main(string argv[]){
abs a = new abs();
a.amethod();
}
public void myfunc(){
system.out.println("my func");
}
public void amethod(){
myfunc();
}
}
1) the code will compile and run, printing out the words "my func"
2) the compiler will complain that the base class has non abstract methods
3) the code will compile but complain at run time that the base class has non abstract methods
4) the compiler will complain that the method myfunc in the base class has no body, nobody at all to looove it

question 2)
what will happen when you attempt to compile and run this code?public class mymain{
public static void main(string argv){
system.out.println("hello cruel world");
}
}
1) the compiler will complain that main is a reserved word and cannot be used for a class
2) the code will compile and when run will print out "hello cruel world"
3) the code will compile but will complain at run time that no constructor is defined
4) the code will compile but will complain at run time that main is not correctly defined

question 3)which of the following are java modifiers?

1) public
2) private
3) friendly
4) transient
5) vagrant

本文来源:https://shitiku.jxxyjl.com/javarenzhengshitijijin/6401.html

Copyright @ 2011- 考试题库网 All Rights Reserved. 版权所有

免责声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。

 站长统计