多语言展示
当前在线:888今日阅读:23今日分享:25

网梯科技JAVA应聘笔试题

将这个应聘试题,贴出来供有需要的小伙伴使用,万一管用呢!对不?
工具/原料

试题

方法/步骤
1

选择题

2

选择题答案:1-3:BAC    4: ACD   5:A4: 由大小写字母、数字、下划线(_)和美元符号($)组成,开头不能是数字。不能使用关键字6-7:CB

3

判断题

4

判断题答案错误 错误 正确  错误

5

简答题

6

简答题答案1、有两条不规则的绳子,燃烧每条绳子需要一个小时.问怎样通过燃烧两条绳子测量出标准的十五分钟?先将一条绳子的两头一起点燃,点燃的同时将另一条绳子的一头点燃。当第一条绳子烧完的时候正好是30分钟,这个时候将第二条绳子的另一头也同时点燃。当第二条绳子也烧完的时候,又过了15分钟。加起来就是45分钟。2、Tomcat、weblogic、websphere  Resin JBoss jetty3、值传递。原因:Java编程语言只由值传递参数。当一个对象实例作为一个参数被传递到方法中时,参数的值就是该对象的引用。对象的内容可以在被调用的方法中改变,但是对对象的引用是永远不会改变的。4、有以下三种写法delete from a where id in (select b.id from b left join a on b.id=a.id)delete from a where id in (select b.id form b)delete from a where id in (select b.id from b inner join a on b.id=a.id)哪个语句更快些,性能更好些,因为两表的记录比较多?结果是一样的,因为你是要删除a表中的ID在B表中存在记录,区别就是:(select b.id from b left join a on b.id=a.id)结果集和(select b.id form b)的结果集是一样的,只不过一个是用左连接得到,一个是直接SELECT理论上是你第3条语句效率更高点,因为IN操作的范围可能会比其他两条语句的小由于要操作上万的记录,有文章介绍不推荐用IN操作,象这样写:delete from a where exists(select 1 from b where a.id=b.id)据说性能更好,弄台慢点的机器,看看这些语句的执行时间就看出来了,其实我感觉效率应该和delete from a where id in (select b.id from b inner join a on b.id=a.id)差不多 5 、select a.s_id,a.m_id,a.g_id,a.a_num,IFNULL(b.b_num,0)FROM a LEFT OUTER JOIN b on a.s_id=b.s_id;6、外键的概念:外键是关系数据库三个完整性的五个约束条件之一,是表与表之间建立的一种关系。加入外键的条件:a、两个表有相同属性字段,取值范围相同;                        b、外键在主表中是主键或者是唯一字段;                        c、外键可以是多个字段的组合。事务管理:就是要么发生,要么发生错误后就回滚事务

7

编程题

8

编程题答案1、public class Test2 {public static void main(String[] args) {int width = 6;for (int i = 0; i < width; i++) {System.out.println(' ');for (int j = 0; j < width; j++) {int x = j + 0;System.out.print(x > i ? i : x);}}}} 2、package test; import java.util.Set;import java.util.TreeSet; public class MyTest { public static Set set = new TreeSet(); public static void perm(char[] n, int beg, int end) {if (beg == end) {addNumber(String.valueOf(n));} else {for (int i = beg; i <= end; ++i) {swap(n, beg, i);perm(n, beg + 1, end);swap(n, beg, i);}}} public static void swap(char[] n, int x, int y) {if (x == y || n[x] == n[y]) {return;}char temp = n[x];n[x] = n[y];n[y] = temp;} public static void addNumber(String str) {if (str.charAt(2) == '4' || str.contains('35') || str.contains('53')) {return;}set.add(str);} public static void main(String args[]) {char[] number = new char[] { '1', '2', '2', '3', '4', '5' };perm(number, 0, number.length - 1);System.out.println(set.size());int cols = 10;for (String s : set) {System.out.print(s + ' ');if (cols-- == 1) {System.out.println();cols = 10;}}}} 3、Illegal modifier for parameter aaa; only final is permitted4、Exception in thread 'main' java.lang.NullPointerException

温馨提示
2

原作者:风起时110想你

推荐信息