Update: 2007.6.26 By: BorderJava面试题TOP10:
JAVA, JSP, SERVLETS, EJB, STRUTS, XML, ANT, LOG4J, WEBLOGIC ... 都有
可以在Goolge.com中搜
java interview questions 或
java 面试题。
如果英语好的还是建议看看英文的,中问的搜来搜去还都是那些东西。
例如:
1.
Why do we need public static void main(String args[]) method in Java We need
public: The method can be accessed outside the class package
static: You need not have an instance of the class to access the method
void: Your application need not return a value, as the JVM launcher would return the value when it exits
main(): This is the entry point for the application
If the main() was not static, you would require an instance of the class in order to execute the method.
If this is the case, what would create the instance of the class? What if your class did not have a public constructor?
2.
Explain serialization Serialization means storing a state of a java object by coverting it to byte stream
3.
What are the rules of serialization Rules:
1. Static fileds are not serialized because they are not part of any one particular object
2. Fileds from the base class are handled only if hose are serializable
3. Transient fileds are not serialized
4.
Is Empty .java file a valid source file? Yes, an empty .java file is a perfectly valid source file.
[Received from Sandesh Sadhale]
5. Is main a keyword in Java?
No, main is not a keyword in Java.
6.What happens if you dont initialize an instance variable of
any of the primitive types in Java?
Java by default initializes it to the default value for that primitive type.
Thus an int will be initialized to 0, a boolean will be initialized to false.
7. How many objects are created in the following piece of code?
MyClass c1, c2, c3; c1 = new MyClass (); c3 = new MyClass ();
Only 2 objects are created, c1 and c3. The reference c2 is only declared and
not initialized.
8. What will be the default values of all the elements of an array defined as
an instance variable?
If the array is an array of primitive types, then all the elements of the array
will be initialized to the default value corresponding to that primitive type. e.g.
All the elements of an array of int will be initialized to 0, while that of boolean
type will be initialized to false. Whereas if the array is an array of references
(of any type), all the elements will be initialized to null.
9. difference between java.sql.Date and java.util.Date
1)
java.util.Date is the superclass for java.sql.Date i.e public class Date extends
java.util.Date { }
2) java.sql.Date is used for databases where we just need to store date and not
time but java.util.date returns Date as well as time
3) java.util.Date has constructor with 0 parameters but java.sql.Date does not
has the one, so we canot use new Date() here, time in milliseconds needs to be passed
10. 用UML画出你所熟悉的设计模式?
11. 什么是序列化?
序列化可以将对象写入字节流,他也可以从字节流中读取对象。将对象状态转换成字节流之后,
可以用java.io包中各种字节流类将其保存到文件中,管道到另一线程中或通过网络连接将对象数据发送到另一主机。
对象序列化功能非常简单、强大,在RMI、Socket、JMS、EJB都有应用。java核心类的许多类都实现了
java.io.Serializable接口而且,java的序列化比较简单,通常不需要编写保存和恢复对象状态的定制代码。
实现java.io.Serializable接口的类对象可以转换成字节流或从字节流恢复,不需要在类中增加任何代码。
--
Blog:
www.borderj.cnMSN:
borderj@live.comBorder
分享到:
相关推荐
java 面试常见题_基础部分 java 面试常见题_基础部分 java 面试常见题_基础部分 java 面试常见题_基础部分 java 面试常见题_基础部分 java 面试常见题_基础部分 java 面试常见题_基础部分 java 面试常见题_基础部分 ...
Java interview-高级Java面试题2019_java-interview.zip
JAVA就业面试题264道_以及答案 JAVA就业面试题264道_以及答案 JAVA就业面试题264道_以及答案 JAVA就业面试题264道_以及答案 JAVA就业面试题264道_以及答案 JAVA就业面试题264道_以及答案 JAVA就业面试题264道_以及...
JAVA面试题集_免费下载
这份"【面试必备】JAVA 最常见面试题全解析 附 PDF"文档,正是为准备Java面试的开发者量身定制的资源,涵盖了Java的基础到高级知识点,旨在帮助你全面理解和掌握Java技术。 一、基础篇 1. Java语法:包括变量、数据...
java面试题_java-interview-questions-master.zip2、在 Java 程序中怎么保证多线程的运行安全? 出现线程安全问题的原因一般都是三个原因: 1、 线程切换带来的原子性问题 解决办法:使用多线程之间同步...
java面试资料_java-interview-lzj
为了在求职过程中脱颖而出,尤其是对于初级工程师来说,掌握扎实的Java基础知识并了解常见的面试题至关重要。这份"最新JAVA编程题全集(50题及答案).doc"文档集合了50个Java编程题目,覆盖了基础语法、面向对象、集合...
面试题包含了不同技术层面的面试问题,同时也能对一些没有面试开发经验的小白给予不可估量的包装, 让你的薪水绝对翻倍, 本人亲试有效.Java面试题84集、java面试专属及面试必问课程,所有的面试题有视屏讲解, 解答方案....
达内 Java 企业面试题精选_扫描版_3.24M
java面试题 100IT名企java面试必考面试题
java面试技术和技巧_Java-Interview
JavaOOP面试题 Java集合/泛型面试题 Java异常面试题 Java中的IO与NIO面试题 Java反射面试题 Java序列化面试题 Java注解面试题 多线程&并发面试题 JVM面试题 Mysql面试题 Redis面试题 Memcached面试题 MongoDB面试题 ...
整理大厂面试题库和Java必备知识。_amber-interview
最新_互联网公司招聘_笔试_开发_【Java常见面试题】_java常见面试题及答案.pdf
【java面试题】100IT名企java面试必考面试题 (Java Interview Question 100 IT Enterprise Java Compulsory Interview Question) 【java面试题】100IT名企java面试必考面试题 (Java Interview Question 100 IT ...
java面试题大全,刚毕业的大学生还是很有用的希望对大家有帮助。
最全的j2EE面试题,题量大、经典,是我面试的整理试题 1、java笔试题大集合 2、各个公司面试题 3、J2EE初学者面试题 4、J2EE面试题(打码查错题) 5、java_华为笔试题 ...15、张孝祥整理Java就业面试题大全
Java面试题集_骆昊12个pdf Java面试汇总_一技之长14个pdf Java系列面试题_磊哥4个pdf 其他_8个pdf 压缩后7701页《第3版:互联网大厂面试题》PDF.zip ---2、文档来源 骆昊的Java就业指导...
"Java 面试题及其答案.doc"和"JAVA面试题.doc"提供了大量的面试题及解答,涵盖了从基础知识到高级特性的广泛范围,包括反射、注解、设计模式、Spring框架、数据库操作等。通过这些题目,求职者可以自我评估,了解...