java高级工程师笔试题
选择题
1:which is the main() method return of a application?
a.string
b.byte
c.char
d.void
2:
what will happen when you attempt to compile and run the following code?
int output = 10;
boolean b1 = false;
if((b1 true) && ((output += 10) 20))
{
system.out.println("we are equal " + output);
}
else
{
system.out.println("not equal! " + output);
}
choices:
what will happen when you attempt to compile and run the following code?
int output = 10;
boolean b1 = false;
if((b1 true) && ((output += 10) 20))
{
system.out.println("we are equal " + output);
}
else
{
system.out.println("not equal! " + output);
}
choices:
a.compilation error, attempting to perform binary comparison on logical data type
b.compilation and output of "we are equal 10".
c.compilation and output of "not equal! 20".
d.compilation and output of "not equal! 10".
3:
what will happen when you attempt to compile and run the following code?
class base
{
int i = 99;
public void amethod()
{
system.out.println("base.amethod()");
}
base()
{
amethod();
}
}
public class derived extends base
{
int i = -1;
public static void main(string argv[])
{
base b = new derived();
system.out.println(b.i);
b.amethod();
}
public void amethod()
{
system.out.println("derived.amethod()");
}
}
choices:
what will happen when you attempt to compile and run the following code?
class base
{
int i = 99;