公告: 迎新年 国内考生IT认证代考价格优惠中 保证百分百通过!

在线咨询

国际IT认证代考俱乐部
代考国际IT认证考试

首页 | 考试流程 | 证书样本 | 认证资讯 | 官方确认 | 代考价格 | 海外港台代考价格 | Microsoft认证 | Cisco认证 | 关于我们

当前位置:当前位置:首页>>认证资讯>>SUN认证>>正文
 

格林模拟试题二(上)



Java Programmer Certification Mock Exam No 2

Copyright ©Marcus Green 2002

Questions


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

 


Question 4)

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

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 is not declared as abstract.
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 5)

Why might you define a method as native?

1) To get to access hardware that Java does not know about
2) To define a new data type such as an unsigned integer
3) To write optimised code for performance in a language such as C/C++
4) To overcome the limitation of the private scope of a method

 



Question 6)

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

class Base{
public final void amethod(){
System.out.println("amethod");
}
}

public class Fin extends Base{
public static void main(String argv[]){

Java Programmer Certification Mock Exam No 2

Copyright ©Marcus Green 2002

Questions


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

 


Question 4)

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

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 is not declared as abstract.
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 5)

Why might you define a method as native?

1) To get to access hardware that Java does not know about
2) To define a new data type such as an unsigned integer
3) To write optimised code for performance in a language such as C/C++
4) To overcome the limitation of the private scope of a method

 



Question 6)

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

class Base{
public final void amethod(){
System.out.println("amethod");
}
}

public class Fin extends Base{
public static void main(String argv[]){

Java Programmer Certification Mock Exam No 2

Copyright ©Marcus Green 2002

Questions


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

 


Question 4)

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

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 is not declared as abstract.
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 5)

Why might you define a method as native?

1) To get to access hardware that Java does not know about
2) To define a new data type such as an unsigned integer
3) To write optimised code for performance in a language such as C/C++
4) To overcome the limitation of the private scope of a method

 



Question 6)

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

class Base{
public final void amethod(){
System.out.println("amethod");
}
}

public class Fin extends Base{
public static void main(String argv[]){

Java Programmer Certification Mock Exam No 2

Copyright ©Marcus Green 2002

Questions


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

 


Question 4)

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

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 is not declared as abstract.
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 5)

Why might you define a method as native?

1) To get to access hardware that Java does not know about
2) To define a new data type such as an unsigned integer
3) To write optimised code for performance in a language such as C/C++
4) To overcome the limitation of the private scope of a method

 



Question 6)

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

class Base{
public final void amethod(){
System.out.println("amethod");
}
}

public class Fin extends Base{
public static void main(String argv[]){
public class As{
int i = 10;
int j;
char z= 1;
boolean b;
public static void main(String argv[]){
As a = new As();
a.amethod();
}
public void amethod(){
System.out.println(j);
System.out.println(b);
}
}

1) Compilation succeeds and at run time an output of 0 and false
2) Compilation succeeds and at run time an output of 0 and true
3) Compile time error b is not initialised
4) Compile time error z must be assigned a char value

 


Question 29)


What will happen when you attempt to compile and run the following code with the command line "hello there"

public class Arg{
String[] MyArg;
public static void main(String argv[]){
MyArg=argv;
}

public void amethod(){
System.out.println(argv[1]);
}
}

1) Compile time error
2) Compilation and output of "hello"
3) Compilation and output of "there"
4) None of the above

 


Question 30)

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

public class StrEq{
public static void main(String argv[]){
StrEq s = new StrEq();
}
private StrEq(){
String s = "Marcus";
String s2 = new String("Marcus");
if(s == s2){
System.out.println("we have a match");
}else{
System.out.println("Not equal");
}
}
}

1) Compile time error caused by private constructor
2) Output of "we have a match"
3) Output of "Not equal"
4) Compile time error by attempting to compare strings using ==

 

>> 代考流程

代考MCPD专业开发人员
代考微软MCSE2003
代考微软MCTS技术专家
代考思科CCVP认证
代考思科CCSP认证
代考思科CCIP认证
代考思科CCDP认证
代考思科CCDA认证
代考思科全能认证
代考思科微软全能认证
代考微软全能认证
代考LPI认证
代考微软MCSD.NET
代考微软MCSE2003
代考微软MCSE2000
代考微软MCP认证
代考思科CCNP认证
代考思科CCNA认证
more

>> 更多友情链接
关于我们 | 网站地图
国际IT认证代考俱乐部 版权所有
QQ:614322024 Msn:itchinaclub@hotmail.com TEL:15861694168