《石化盈科笔试题》由会员分享,可在线阅读,更多相关《石化盈科笔试题(4页珍藏版)》请在金锄头文库上搜索。
1、1.程序执行结果是什么.publicclass Encapsulation class ClassValuepublicinti=15; publicstaticvoid main(String args) / TODO Auto-generated method stubEncapsulation t=new Encapsulation();t.first();publicvoid first()ClassValue cv=new ClassValue();second(cv);System.out.println(cv.i:+cv.i);publicvoid second(ClassVal
2、ue v)ClassValue cv=new ClassValue();v.i=25;v=cv;System.out.println(v.i:+v.i);2.程序输出结果是什么class A publicvoid show() System.out.println(class a show );class B extends A publicvoid show() System.out.println(class a show );publicclass Inherit /* * param args */publicstaticvoid main(String args) A a = new
3、 B();if (a instanceof A) System.out.println(A );if (a instanceof B) System.out.println(B );3.程序输出结果是什么publicclass Polymorphic /* * param args */publicstaticvoid main(String args) / TODO Auto-generated method stubParent pare = new Sub();pare.show();class Parent publicvoid show() System.out.println(cl
4、ass Parent show );class Sub extends Parent publicvoid show() System.out.println(class Sub show );4.程序输出结果是什么publicclass tryCatch /* * param args */publicstaticvoid main(String args) try System.out.println(begin );System.out.println(end );return; catch (Exception e) System.out.println(excepton ); fin
5、ally System.out.println(finally);5.对一个整型数组进行排序publicclass MySort publicstaticvoid main(String args) MySort sort = new MySort();int arr = newint 3, 22, 11, 5, 400, 99, 20, 22, 5 ;sort.sort(arr);for (int i : arr) System.out.print(i + ,);publicvoid sort(int targetArr) / 小到大的排序int temp = 0;for (int i =
6、0; i targetArr.length; i+) for (int j = i; j targetArr.length; j+) if (targetArri targetArrj) / 方法一:temp = targetArri;targetArri = targetArrj;targetArrj = temp;/* * /方法二: targetArri = targetArri + targetArrj; * targetArrj = targetArri - targetArrj; targetArri * = targetArri - targetArrj; */ 方法三:/ targetArri = targetArritargetArrj;/ targetArrj = targetArritargetArrj;/ targetArri = targetArritargetArrj;6.sql题目有两张表student,和scopeStudent:学号,姓名,性别,年龄Scope:学号,语文,数学,英语1. 查询张三的学号,姓名,性别, 语文,数学,英语2. 查询语文比数学好的同学3. 查处姓名相同的学生学号7.画出客户网上买书的实体关系图,并且查出交易金额最大的客户.