华为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. <%=>
-
面试个人简历(15篇)
时间真是转瞬即逝,我们找工作的时间越来越近,这时是不是该好好写一份简历了呢?你知道简历要如何写吗?下面是小编整理的面试个人简历,仅供参考,大家一起来看看吧。面试个人简历1姓名:民族:汉族年龄:26岁联系方式:求职意向及工作经历应聘职位:前台接待/文员/经理助理工作年...
-
面试简历的自我评价通用15篇
光阴的迅速,一眨眼就过去了,又到了求职找工作的时候,是时候好好地琢磨一下写简历的事情了哦。那么如何写简历才简练、明确呢?以下是小编精心整理的面试简历的自我评价,仅供参考,大家一起来看看吧。面试简历的自我评价1酷爱外贸英语,拥有国家TEM-4和CET-6证书1)熟练操...
-
面试优缺点怎么说
面试优缺点怎么说1回答示范1:我比较善于发现问题、解决问题。比方说,我们公司有鼓励员工提建议的制度,在两年的工作中我提出了60多条改善提案,80%被采用,总积分在我科533人中居第三。除了技术上的改善提议,我也提了很多管理方面的小建议,比方说工作时间播放轻音乐,厕所...
-
单位面试通知书(3篇)
在现实社会中,我们都跟通知有着直接或间接的联系,通知适用于批转下级机关的公文,转发上级机关和不相隶属机关的公文。相信很多朋友都对写通知感到非常苦恼吧,下面是小编精心整理的单位面试通知书,仅供参考,希望能够帮助到大家。单位面试通知书1各招聘单位,各应聘考生:...