java基本语法和jsp,关于数据库方面的比如SQL
解决方案 »
- 求助一个字符串中很妙的分行问题?
- 为什么公开的类在的文件的名字必须和类名相同?
- 连接mysql的问题,一个模拟登陆验证的界面
- 请教一个BufferedReader和socket.getInputStream()的问题~~~
- 为什么不能 排序
- 如何通过正则表达式将select t1.c1,t2.c2 from table1 t1 中select 与 from之间的字符串提取出来或换成其他字符串?
- 个人收藏的编程下载资源全部公布!!!
- 求救!关于打印的问题!
- 谁知道jbuiler 6在那里下载?多谢!!(急用)
- j2exe怎么将jvm.dll文件包含进去?
- !!!!关于键盘响应的问题!!!!
- 如何做到java调用流览器并在出现在最上面?
我开始也觉得问问他JAVA各方面了解程度,考一些基本的东西,比如语法,比如考一些程序的阅读(主要从SCJP考题中抽取)。可我老板不同意,说那些没用,就要出一个设计题目,具体什么他也不知道。我觉得很为难,JAVA大学不学吧?那个来面试的学生不知道学到什么程度。
老板实在急着用人,但有太功利性了。
要是真的出什么题目,大家说出什么呢?给一个具体点的题目好吗?
jsp+beans 或applet编程题任选一个
我其实很不同意老板的做法,他居然说让他用JAVA写一个类似记事本之类的东西。我也不知道用JAVA难不难写,不过那样做肯定不好。
只要人够聪明,肯学习,基础不是问题,嘿嘿
那你很幸运啊!那你老板给你出了什么题目?给我说说啊!
下面是我出的题,已经用来考过几个,跟我一界毕业的了。但是,效果不太好。你看着办吧。
限时1小时。附答案。
Question 1.
What will be the result of attempting to compile and run the following code?public class Q6b0c {
public static void main(String[] args) {
int i = 4;
float f = 4.3;
double d = 1.8;
int c = 0;
if (i == f) c++;
if (((int) (f + d)) == ((int) f + (int) d)) c += 2;
System.out.println(c);
}
}Question 2.
Under which circumstances will a thread stop?a. The run() method that the thread is executing ends.
b. The call to the start() method of the Thread object returns.
c. The suspend() method is called on the Thread object.
d. The wait() method is called on the Thread object.
Question 3.
Which declarations of the main() method are valid in order to start the execution of an application?
a. public void main(String args[])
b. public void static main(String args[])
c. public static main(String[] argv)
d. final public static void main(String [] array)
e. public static void main(String args[])
Question 4.
Which statements concerning the methods notify() and notifyAll() are true?
a. Instances of class Thread have a method called notify().
b. A call to the method notify() will wake the thread that currently owns the monitor of the object.
c. The method notify() is synchronized.
d. The method notifyAll() is defined in class Thread.
e. When there is more than one thread waiting to obtain the monitor of an object, there is no way to be sure which thread will be notified by the notifiy() method.
Question 5.
Which methods from the String and StringBuffer classes modify the object on which they are called?
a. The charAt() method of the String class.
b. The toUpperCase() method of the String class.
c. The replace() method of the String class.
d. The reverse() method of the StringBuffer class.
e. The length() method of the StringBuffer class.
Question 6.
Which is the earliest line in the following code after which the object created in the line ed (0) will be a candidate for garbage collection, assuming no compiler optimizations are done?public class Q76a9 {
static String f() {
String a = "hello";
String b = "bye"; // (0)
String c = b + "!"; // (1)
String d = b; // (2)
b = a; // (3)
d = a; // (4)
return c; // (5)
}
public static void main(String[] args) {
String msg = f();
System.out.println(msg); // (6)
}
}Question 7.
If str denotes a String object with the string "73", which of these expressions will convert the string to the int value 73?
a. Integer.intValue(str)
b. ((int)str)
c. (new Integer(str)).intValue()
d. Integer.parseInt(str)
e. Integer.getInt(str)
Question 8.
Which of these are keywords in Java?
a. default
b. NULL
c. String
d. throws
e. longQuestion 9.
Given the following class definitions, which expression identifies whether the object referred to by obj was created by instantiating class B rather than classes A, C and D?class A {}
class B extends A {}
class C extends B {}
class D extends A {}a. obj instanceof B
b. obj instanceof A && !(obj instanceof C)
c. obj instanceof B && !(obj instanceof C)
d. !(obj instanceof C || obj instanceof D)
e. !(obj instanceof A) && !(obj instanceof C) && !(obj instanceof D)Question 10.
Which statements, when inserted at the indicated position in the following code, will cause a runtime exception?class A {}
class B extends A {}
class C extends A {}
public class Q3ae4 {
public static void main(String[] args) {
A x = new A();
B y = new B();
C z = new C();
// insert statement here
}
} a. x = y;
b. z = x;
c. y = (B)x;
d. z = (C)y;
e. y = (A)y; Author: Liao Jian
Test range: Java basic knowledge, OO theory, English Reading ability, 一个人的细心程度。
Answers:
1. Failed to compile at Line 4. Because of possible loss of precision. If you change to “float f = 4.3f;” then the answer would be “0”.
2. a.
3. d, e
4. a, e
5. d
6. Line 4
7. c, d
8. a, d, e
9. c
10. c are the right answers. a is right.d, b, e fail to compile.
谢谢Norwaywoods()提供考题,我觉得很好,我会考虑的。
我建议考一些思路题,即使考设计题什么的,也不应该仅局限java,其实什么语言对毕业生都没多大差别。
-------------------------------------
我觉得面向对象的概念,编程风格很重要啊。最怕的是那种以为做得对,功能也能实现,但是代码结构等就是垃圾哪一种,恐怕那就是他肯学,概念上也转不过了,其他应该好说吧。基本上就是楼上兄弟说的细心和oo概念。这不是光学能学得会的,要比较长的时间来培养那种感觉。up