華爲Java面試題
第一部分:選擇題
QUESTION NO: 1
1、public class Test {
public static void changeStr(String str){
str="welcome";
}
public static void main(String[] args) {
String str="1234";
changeStr(str);
tln(str);
}
}
please write the output result :
QUESTION NO:2
1. public class Test {
2. static boolean foo(char c) {
3. t(c);
4. return true;
5. }
6. public static void main( String[] argv ) {
7. int i =0;
8. for ( foo(A); foo(B)&&(i<2); foo(C)){
9. i++ ;
10. foo(D);
12. }
13. }
14. }
What is the result?
A. ABDCBDCB
B. ABCDABCD
C. Compilation fails.
D. An exception is thrown at runtime.
QUESTION NO: 3
1. class A {
2. protected int method1(int a, int b) { return 0; }
3. }
Which two are valid in a class that extends class A? (Choose two)
A. public int method1(int a, int b) { return 0; }
B. private int method1(int a, int b) { return 0; }
C. private int method1(int a, long b) { return 0; }
D. public short method1(int a, int b) { return 0; }
E. static protected int method1(int a, int b) { return 0; }
QUESTION NO: 4
1. public class Outer{
2. public void someOuterMethod() {
3. // Line 3
4. }
5. public class Inner{}
6. public static void main( String[]argv ) {
7. Outer o = new Outer();
8. // Line 8
9. }
10. }
Which instantiates an instance of Inner?
A. new Inner(); // At line 3
B. new Inner(); // At line 8
C. new r(); // At line 8
D. new r(); // At line 8//new Outer() Inner()
QUESTION NO: 5
Which method is used by a servlet to place its session ID in a URL that is written to the servlet’s response output stream?
A. The encodeURL method of the HttpServletRequest interface.
B. The encodeURL method of the HttpServletResponse interface.
C. The rewriteURL method of the HttpServletRequest interface.
D. The rewriteURL method of the HttpServletResponse interface.
QUESTION NO: 6
Which two are equivalent? (Choose two)
A. <%=>
-
跳槽面試注意事項
跳槽面試注意事項1一、跳槽面試需要注意什麼跳槽後面試時,通常會被問到的一個題目是——請描述一下你離開以前所供職單位的理由。這就需要我們集中智慧,巧妙的避開陷阱。“你爲什麼要離職?”在回答這個問題時應該集中精力。像人員臃腫阻礙了能力發揮、上班路途太...
-
個人面試自我評價(集錦8篇)
在生活、工作和學習中,我們最不陌生的就是自我評價了,自我評價不僅影響社會中人與人的交往方式,而且影響社會中人的心理健康程度,影響人的價值觀和人生觀的合理程度。怎麼寫自我評價才能避免踩雷呢?以下是小編整理的個人面試自我評價,希望能夠幫助到大家。個人面試自...
-
關於面試通知模板
在現在的社會生活中,我們需要用到通知的情形越來越多,下達指示、佈置工作、傳達有關事項、傳達領導意見、任免幹部、決定具體問題,都可以用通知。相信許多人會覺得通知很難寫吧,以下是小編幫大家整理的關於面試通知模板,僅供參考,大家一起來看看吧。關於面試通知模板...
-
克服面試中緊張情緒
克服面試中緊張情緒11.演講者應認識到緊張感是演講中的一種自然現象絕大多數的演講者在演講中都不可避免地或多或少伴有緊張感,古今中外,許多的語言大師,如林肯、田中角榮、邱吉爾,他們的第一次演講都是因緊張而以失敗告終的。對此,演講者應該有一個清醒的認識,明確...