aftyingjiesheng 发表于 2011-6-28 10:39

2011年新浪微博实习生笔试面试题

2011年新浪微博实习生笔试面试题


不定项选择:
1. 不能用来修饰interface的有()
A.private B.public C.protected D.static
2.System.out.println(-1>>>1) 输出什么.
A.-1 B.1 C. 2147483647 D. -2147483647
3. 下列有关Servlet的生命周期,说法不正确的是()。
A、在创建自己的Servlet时候,应该在初始化方法init()方法中创建Servlet实例。
B、在Servlet生命周期的服务阶段,执行service()方法,根据用户请求的方法,执行相应的doGet()或是doPost()方法。
C、在销毁阶段,执行destroy()方法后系统立刻进行垃圾回收。
D、destroy()方法仅执行一次,即在服务器停止且卸载Servlet时执行该方法。
4. 关于异常处理机制的叙述哪些正确()
    A. catch部分捕捉到异常情况时,才会执行finally部分
    B. 当try区段的程序发生异常时,才会执行catch区段的程序
    C. 不论程序是否发生错误及捕捉到异常情况,都会执行finally部分
D. 以上都是

下列程序有错误吗,错在那里
1.
public class Something {
      void doSomething() {
                private String s = "";
                int i = s.length();
      }
}





2.
abstract class Something {
         private abstract String doSomething ();
}





3.
public class Something {
    public static void main(String[] args) {
       Something s = new Something();
       System.out.println("s.doSomething() returns " + doSomething());
   }
   public String doSomething() {
       return "Do something ...";
   }
}



4.
public class Something {
      public static void main(String[] args) {
                Other other= new Other();
                new Something().addOne(other);
      }
      public void addOne(final Other other){
                other.i++;
      }
}
class Other{
      public int i;
}



5.
interface A {
      int x = 0;
}
class B {
      int x = 1;
}
class C extends B implements A {
      public void printX() {
                System.out.println(x);
      }
      public static void main(String[] args) {
                new C().printX();
      }
}      
编程题:
1.      jsp有哪些内置对象?作用分别是什么?






2.      由于没有设置主键,表weibo有许多重复记录,写一个sql,把所有重复的记录删除掉,留下唯一的记录。





3.      写一个方法,输入任意一个整数,返回它的阶乘.




4.      写一个程序三个线程分别输出A,B,C,顺序输出ABC十次.



5.      写一个二分查找算法,注意细节.

原文链接:http://bbs.aftjob.com/thread-609425-1-1.html

Zz:该内容转载自网络,版权归原作者所有。

新浪求职俱乐部:http://bbs.aftjob.com/group-49-1.html
新浪微博2011实习招聘专题:
http://bbs.aftjob.com/portal.php?mod=topic&topicid=21
页: [1]
查看完整版本: 2011年新浪微博实习生笔试面试题