ikm java_2013Morgan Stanley IKM assessment
今天做了一下Morgan Stanley 的IKM assessment,我選擇的是java方向,26分鐘,沒有規(guī)定有少道題,都是多選題,5個選項,最多可以選三個。
感覺這個系統(tǒng)好特別,比如說有好幾個選項都是對的,但是判斷不同選項正確與否的難易程度不一樣,正確選擇到那些比較有含金量的選項,最后的得分會高些。
回憶一下其中的一些題。
1.Java 異常處理
public class Test {
public static void main(String args[]) {
int x = 5;
int y = 0;
int z = 3;
try {
try {
System.out.println(x);
System.out.println(x / y);
System.out.println(z);
} catch (ArithmeticException ae) {
System.out.println("Inner Arithmetic Exception");
throw ae;
} catch (RuntimeException re) {
System.out.println("Inner Runtime Exception");
throw re;
} finally {
System.out.println("Finally");
}
} catch (Exception e) {
System.out.println("Outer Exception");
}
}
}
運行結果:
5
Inner Arithmetic Exception
Finally
Outer Exception
第二句打印中,產生除零異常,這時捕獲異常的catch塊,首先捕獲到算術異常,打印出Inner Arithmetic Exception。捕獲到異常后,還可以再次拋出異常之,如代碼中所示。
在同一個try中,異常被捕獲后不會再往下傳遞,所以內部的第二個異常捕獲塊沒有捕獲到Runtime Exception。
在異常捕獲之后,finally語句是一定會執(zhí)行的,一般情況下在finnaly中做一些善后處理工作。這里打印出Finally。
在外層還有catch塊捕獲異常,這里所捕獲的就是剛才又throw出來的異常,所以會打印出Outer Exception。
如果沒有代碼中的throw語句,外層try{}catch(){}將不會捕獲到異常。
2. Math的各種用法
public class Test {
public static void main(String args[]) {
double d = -27.2345;
System.out.println(Math.round(d));
System.out.println(Math.abs(d));
System.out.println(Math.floor(d));
System.out.println(Math.ceil(d));
}
}
運行結果:
-27
27.2345
-28.0
-27.0
這題考查的是對Math各種用法的使用。
(1)long java.lang.Math.round(double a) 對a四舍五入
Returns the closest long to the argument, with ties rounding up.
Special cases:
If the argument is NaN, the result is 0.
If the argument is negative infinity or any value less than or equal to the value of Long.MIN_VALUE, the result is equal to the value of Long.MIN_VALUE.
If the argument is positive infinity or any value greater than or equal to the value of Long.MAX_VALUE, the result is equal to the value of Long.MAX_VALUE.
(2)double java.lang.Math.abs(double a) 求a的絕對值
Returns the absolute value of a double value. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned. Special cases:
If the argument is positive zero or negative zero, the result is positive zero.
If the argument is infinite, the result is positive infinity.
If the argument is NaN, the result is NaN.
(3)double java.lang.Math.floor(double a) 求不大于a小的最大值
Returns the largest (closest to positive infinity) double value that is less than or equal to the argument and is equal to a mathematical integer. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
(4)double java.lang.Math.ceil(double a) 求不小于a的最小值
Returns the smallest (closest to negative infinity) double value that is greater than or equal to the argument and is equal to a mathematical integer. Special cases:
If the argument value is already equal to a mathematical integer, then the result is the same as the argument.
If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
If the argument value is less than zero but greater than -1.0, then the result is negative zero.
floor是“地板”,向下取數;ceil是“天花板”,向上取數。
3. OSI體系結構中的網絡通信模型,physical layer的功能屬性
隱約記得選項有:比特同步;將package拆分成frame;與Session相關balalala。。。其他的記不清楚了。
由于時間本身就不長,加上全英文的題,讀題加上理解都得半天,最后好像就做了15題左右,感覺肯定要悲劇了。
果然像大摩這樣的地方來者不善啊,被小小的打擊了一下。考的內容總體來說比較基礎,也很細致,還有一些設計模式的題,由于沒有接觸過太多,基本都skip掉了。這應該是根據大摩項目特點有關系,金融IT項目要求健壯性和維護性高,需要準確的細節(jié)和良好的設計作為支撐。
總結
以上是生活随笔為你收集整理的ikm java_2013Morgan Stanley IKM assessment的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 辛巴宣布复出 再给网红带货一次机会
- 下一篇: 什么系统战时必须优先传递发放防空警报信号