栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > Java面试题

福富软件2010年Java面试题

Java面试题 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

福富软件2010年Java面试题

 

选择40题,每题1.5分

考察内容

题数

基础类型:如何定义一个十六进制的long变量?

1题

位运算(<<,>>)

1题

finalize方法使用

1题

修饰符访问权限(public, protected, default, private)

1题

Java对象的周期?(创建,使用,不可达?)

1题

Exception

1题

二进制IO

1题

同步、锁

1题

对象的定义

1题

Java为啥能跨平台

1题

Socket编程

1题

序列化

1题

GC(如何对某个对象进行垃圾回收)

1题

JDBC-ODBC(何时使用JDBC-ODBC桥)

1题

JDBC处理顺序

1题

集合框架-哪个接口可以存储不重复的数据集合,并按自然顺序排列?

1题

集合框架-HashMap与Hashtable的区别

1题

Java 编码:选出错误的一个

A.   Java用Unicode保存字符及字符串

B.   “中文”.getBytes().length一定等于4

C.   “中文”.equals(new String(“中文”, “UTF-8”), “UTF-8”)为true

D.   “中文”???忘记了

1题

try {

ServerSocket  server = new ServerSocket(8080);

DatagramSocket socket = new DatagramSocket(8080);

server.accept();

} catch(Exception e) {

e.printStackTrace();

}

System.out.println(“success”); int a = 1, b = 2, c = a * b;

long d = c * 3;

switch(d)

{

case 4:

System.out.println(“c=4”);

case 5:

System.out.println(“c=5”);

case 6:

System.out.println(“c=6”);

default:

System.out.println(“c=default”);

} public class A {

private String str;

 

public A(String str) {

this.str = str;

}

 

public static void main(String[] args) {

A a1 = new A(“Hello”);

A a2 = new A(“Hello”);

A a3 = a1;

String s1 = new String(“Hello”);

String s2 = new String(“Hello”);

System.out.println(a1 == a2);

System.out.println(a1.equals(a2));

System.out.println(a1 == a3);

System.out.println(a1.equals(a3));

System.out.println(s1 == s2);

System.out.println(s1.equals(s2));

}

} public class Test {

private static String staticField = “A”;

 

private String field = “C”;

 

{

System.out.println(field);

System.out.println(“D”);

}

 

static {

System.out.println(staticField);

System.out.println(“B”);

}

 

public Test(String str) {

System.out.println(str);

}

 

public static void main(String[] args) {

new Test(“E”);

}

} float a = 10.0;

System.out.println(a/3); Inner Class的定义 public class A {

public void changevalue(int a) {

this.a += 100;

}

 

public static void main(String[] args) {

int a = 10;

changevalue(a);

changevalue(a);

changevalue(a);

System.out.println(a);

}

} public class Parent {

public int I = 10;

class Sub extends Parent {

public int I = 20;

}

 

class Sub2 {

int I = 3;

public static void main(String[] args) {

Parent  p1 = new Parent();

Parent  p2 = new Sub();

Sub2     s2  = new Sub2();

System.out.println(p1.i + p2.i + s2.i);

}

}

} public class TestThread extends Thread {

public void run() {

// 代码略..

}

 

public static void main(String[] args) {

Thread thread1 = new TestThread();

System.out.println(“thread(a): ” + thread1.isLive());

thread1.start();

System.out.println(“thread(b): ” + thread1.isLive());

thread1.join();

System.out.println(“thread: ” + thread1.isLive());

}

} public class Test {

public static void method1() throws IOException {

throw new IOException();

}

 

public static void main(String[] args) throws IOException {

try {

method1();

} catch(IOException e) {

System.out.println(“This is IOException”);

} catch(Exception e1) {

System.out.println(“This is Exception”);

} finally {

System.out.println(“This is finally.”);

}

}

} Servlet好像考了1题? 数据结构-二叉树(结点1001个,叶子结点501个,求度数2结点个数?)

1题

数据结构-哈希表(给出哈希函数与值,求插入后位置)

1题

数据结构-双向链表(在最后一个元素后插入新元素,并删除最后的元素)

1题

HTTP协议

1题

SSL

1题

在Javascript中以下哪句是正确的?

A. null instanceOf Object

B. NaN == NaN

C. null === undefined

D. null == undefined

1题

UML(读UML图,问意思)

1题

 

填空10空,每空2分

1)用什么修饰声明类属性?(static)

2)用什么修饰方法可以避免子类覆盖该方法?(final)

3)面向对象程序设计的三个基本原则是?(封装,继承,多态)

4)若int a = 1, b = 3,在if(a>b&&a++<5)之后a的值是?

若int a = 1, b = 3,在if(a>b&a++<5)之后a的值是?

5)代码填空(a),(b),(c)。一段读文件写文件的代码。

 

编程2题,每题10分

1)

① 你知道几种排序算法?列出二个即可。

② 实现一种排序算法,补完以下方法:

public void sort(int[] data) {

}

 

private void swap(int[] data, int xIndex, int yIndex) {

}

 

2)实现一个单链表,结点结构为data link,补完以下方法。

public class link {

 

private static class Node {

// 补完结构

}

 

public link() {}

 

public link(Integer[] data) {

// 补完方法

}

 

public Node getHeader() {

// 补完方法

}

 

public void printMax() {

// 补完方法

}

 

}

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/264425.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号