广州面试题------爱立信01

Part I Single Selection (2 score per question)
1.  Which statement is true?( )
public void test(int x) {
int odd = 1;
if (odd) {
System.out.println("odd");
} else {
System.out.println("even");
}
}
(A) "odd" will always be output.
(B) "even" will always be output.
(C) Compilation fails.
(D) "odd" will be output for odd values of x, and "even" for even values.
2.  Which one is not valid IP address ?
(A) 192.168.0.254 (B) 192.168.0.255 (C) 192.168.255.254 (D) 192.168.0.256
3.  Select the one correct answer. The number of characters in an object of a class String is given by( )
(A) The member variable called size.
(B) The member variable called length
(C) The method size() returns the number of characters.
(D) The method length() returns the number of characters.
4.  Which code determines the int value data closer to, but not greater than, a double value b? ( )
(A) Int data = (int) Math.floor(b);
(B) Int data = (int) Math.abs(b);
(C) Int data = (int) Math.ceil(b);
(D) Int data = (int) Math.min(b);
5.  Linux file permission setting is presented by one string which length is 10,
it can be divided into 4 parts from left to right, So what is the meaning of the part 3 ?
Such as "drwxrwxr-x" => part1:"d", part2:"rwx", part3:"rwx", part4:"r-x"
(A) file type (B) permissions of file owner (C) permissions of file owner's group (D) permissions of other users
6.  What will be the output of the program? ( )
public class X {
public static void main(String[] args) {
try {
badMethod();
System.out.print("A");
} catch (RuntimeException ex) {
System.out.print("B");
} catch (Exception ex1) {
System.out.print("C");
} finally {
System.out.print("D");
}

System.out.print("E");

}
public static void badMethod() {
throw new RuntimeException();
}
}
(A) BD
(B) BCD
(C) B

(D) BDE

7.  What is valid returnType for getData? ( )
public class ReturnData {
<returnType> getData(byte a, double z) {
return (a / z) * 10;
}
}
(A) short (B) byte (C) int (D) double
8.  What is the result? ( )
public static void mai

  • 1
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值