华为公司 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.
-
个人面试自我评价9篇
在日常学习、工作和生活中,我们都不可避免地要写自我评价,自我评价极大地影响人与人之间的交往方式,也决定着一个人对待他人的态度,还影响对他人的评价。那么你有了解过自我评价吗?下面是小编精心整理的个人面试自我评价,仅供参考,欢迎大家阅读。个人面试自我评价1本...
-
单位面试通知书(3篇)
在现实社会中,我们都跟通知有着直接或间接的联系,通知适用于批转下级机关的公文,转发上级机关和不相隶属机关的公文。相信很多朋友都对写通知感到非常苦恼吧,下面是小编精心整理的单位面试通知书,仅供参考,希望能够帮助到大家。单位面试通知书1各招聘单位,各应聘考生:...
-
2022年面试的自我评价通用15篇
在我们平凡的日常里,我们经常遇到需要写自我评价的情况,自我评价在很大程度上还会自我督促,促使我们维持自我的一致性。怎样写自我评价才合理、得体呢?下面是小编为大家收集的2022年面试的自我评价,欢迎大家借鉴与参考,希望对大家有所帮助。2022年面试的自我评价1面...
-
个人面试自我评价(集锦8篇)
在生活、工作和学习中,我们最不陌生的就是自我评价了,自我评价不仅影响社会中人与人的交往方式,而且影响社会中人的心理健康程度,影响人的价值观和人生观的合理程度。怎么写自我评价才能避免踩雷呢?以下是小编整理的个人面试自我评价,希望能够帮助到大家。个人面试自...