Java软件中级项目工程师笔试题-复杂逻辑.doc





《Java软件中级项目工程师笔试题-复杂逻辑.doc》由会员分享,可在线阅读,更多相关《Java软件中级项目工程师笔试题-复杂逻辑.doc(10页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、/J2EE部分1、运算符优先级问题,下面代码的结果是多少?(笔试)package test;public class Test public static void main(String args) int k = 0;int ret = +k + k+ + +k + k;/ ret的值为多少System.err.println(ret);2、运算符问题,下面代码分别输出什么?(笔试) package test;public class Test public static void main(String args) int i1 = 10, i2 = 10;System.err.prin
2、tln(i1 + i2 = + i1 + i2);System.err.println(i1 - i2 = + i1 - i2);System.err.println(i1 * i2 = + i1 * i2);System.err.println(i1 / i2 = + i1 / i2);3、下面代码的结果是什么?还是抛出异常?(笔试) package test;public class Test public void myMethod(String str) System.err.println(string);public void myMethod(Object obj) System
3、.err.println(object);public static void main(String args) Test t = new Test();t.myMethod(null);4、假设今天是9月8日,下面代码输出什么?(笔试) package test;import java.util.Date;public class Test public static void main(String args) Date date = new Date();System.err.println(date.getMonth() + + date.getDate();5、下面代码的输出结果是
4、什么? package test;public class Test public static void main(String args) double val = 11.5;System.err.println(Math.round(val);System.err.println(Math.floor(val);System.err.println(Math.ceil(val);6、下面代码的结果是什么?package test;public class Test extends Base public static void main(String args) Base b = new
5、 Test();b.method();Test t = new Test();t.method();Overridepublic void method() System.err.println(test);class Base public void method() throws InterruptedException System.err.println(base);7、以下代码的结果是什么? package test;public class Test extends Base public static void main(String args) new Test().metho
6、d();public void method() System.err.println(super.getClass().getName();System.err.println(this.getClass().getSuperclass().getName();class Base 8、true or false?package test;public class Test public static void main(String args) String str1 = new String(abc);String str2 = new String(abc);System.err.pr
7、intln(str1.equals(str2);StringBuffer sb1 = new StringBuffer(abc);StringBuffer sb2 = new StringBuffer(abc);System.err.println(sb1.equals(sb2);9、输出的结果是什么? package test;public class Test public static void main(String args) System.err.println(new Test().method1();System.err.println(new Test().method2()
8、;public int method1() int x = 1;try return x; finally +x;public int method2() int x = 1;try return x; finally return +x;这样呢?输出什么 package test;public class Test public static void main(String args) System.err.println(method();public static boolean method() try return true; finally return false; 10、方法
9、m1和m2有区别吗?什么区别 package test;public class Test public static void main(String args) public synchronized void m1() public static synchronized void m2() 11、true or false?理由 package test;public class Test public static void main(String args) Integer i1 = 127;Integer i2 = 127;System.err.println(i1 = i2);
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- java 软件 中级 项目 工程师 笔试 复杂 繁杂 逻辑

限制150内