分享:某单位Java笔试题(二)
接 http://wwwcomy.iteye.com/blog/1855251 上篇文章
[list]15.下面程序的运行结果是什么?(考察正则表达的,不难)
package com.iteye.test;public class Test {public static void main(String[] args) {System.out.println(Test.class.getName().replaceAll(".", "/") + ".class");}}16.请提供一个对i的声明,使下面循环变为无限循环:
while(i!=i){}
double i = Double.NaN;17.看程序写结果:
public class PingPong {public static synchronized void main(String[] a) {Thread t = new Thread() {public void run() {pong();}};t.run();System.out.print("Ping");}static synchronized void pong() {System.out.print("Pong");}}
static void test() {int j = 0;for (int i = 0; i < 100; i++) {j = j++;}System.out.println(j);}19.实现BIO方式的Socket服务端客户端。这个写两次就知道怎么回事儿了,不难。20.题没看懂,略。。21.如何判断PDF是否带毒。。。没答。22.如何找出两个单向链表的第一个公共节点。23.用户要求你在生产机上的数据库加个字段,你该怎么办。24.如何判断一个整数是否在给定的40E个没排序的unsigned int整数当中?25.实现递归和非递归的斐波那契额数列。这个也不难,看过动态规划的都知道。26.Hadoop相关姿势:三种运行模式,M-S模式的节点功能,容错特性体现在哪里等等。