面试1

yes1.    How you understand the application context and web.xml.

a)     AnApplicationContext provides:
   Bean factory methods. This avoids the need forapplications to use singletons.
   The ability to resolve messages, supportinginternationalization. Inherited from the MessageSource interface.
   The ability to load file resources.Inherited from the ResourceLoader interface.
   The ability to publish events. Implementations mustprovide a means of registering event listeners.
   Inheritance from a parent context. Definitions in adescendant context will always take priority. This means, for example, that asingle parent context can be used by an entire web application, while eachservlet has its own child context that is independent of that of any otherservlet.
b)     The web.xml file provides basic configuration anddeployment information for the Web components.

 
2.     How you use the JDBC or connection pool?

a)     JDBC

1)     Loadthe driver
2)     Define the Connection URL
3)     Establish the Connection
4)     Create a Statement or Preparedstatement object
5)     Execute a query
6)     Process the results
7)     Close the connection

b)     ConnectionPool

i.     TheJDCConnectionPool.java class makes connections available to calling program inits getConnection method. This method searches for an available connection inthe connection pool. If no connection is available, a new connection will becreated. If a connection is available from the pool, the getConnection methodwill get the connection and returns it to the calling program.

  3. What is the difference between get and post, string and string buffer,Vector and ArrayList , hashmap and hashtable?

1) get and post:
    a. Dataof post is secret while Data of get is not.
    b. Getmethod has limited size(256) but Post has not.
    c. Getmethod is faster than Post method in Data transmission.
2) String and Stringbuffer: The biggest difference between these two classes isthat StringBuffer is faster than String when performing simple concatenations. Because when we use a string parameter + oneanother, it also invokes the append method of Stringbuffer.
What is Stringbuilder? What the difference between StringBuffer /StringBuilder?

Main difference between String and StringBuffer is String isimmutable while StringBuffer is mutable [不可改 变的].

The only difference between StringBuffer and StringBuilder is thatStringBuilder is unsynchronized whereas StringBuffer is synchronized. So whenthe application needs to be run only in a single thread then it is better touse StringBuilder. StringBuilder is more efficient than StringBuffer.


3) Vector and Hashtable: A Hashtable is a collection of data to store eachelement (piece of data) via a key.
4) Hashmap and hashtable: Hashmap is almost similar to Hashtable, but there are2 differences between them. 1.Hashtable is synchronized and Hashmap isunsynchronized. 2.HashMap allows null values as its key and value whereasHashtable doesn’t allow. Also note that only one NULL value is allowed as a keyin HashMap. HashMap does not allow multiple keys to be NULL. Nevertheless, itcan have multiple NULL values.
5)Set and List: The biggest difference between them is that Set does not allowduplicated values but List allows.

4. Which Architecture do you used? Have you use Spring? Which module you usedin Spring? Can you explain the AOP, IOC or MVC? An example for IoC?
Spring/ Struts/Hibernate and so on.
I often use the AOP, Spring ORM.
AOP: In my opinion, AOP is always used to separate basic functionsand business logic. We used it in Log, connection and something isolated withour true business.
IoC: (Inversion of Control) It provides another way to create anobject instance with xml configuration with light level.
MVC: Model-View-Control. This structure can divide the development teaminto pieces and improve the efficiency of development.
5. Have you use the JQuery? Can you explain it? Can you brief the charactersof JQuery?
I do not have much experience in JQuery, but I know it is one kind ofJavascript and it is designed to make it easier to navigate a document, selectDOM elements, create animations, handle events, and develop Ajax applications.It could improve the friendly impress of UI.


6. How you understand JSP and Servlet?
In frankly, they are the same ones. After compile into server, Jsp will betransformed into servlet.
7. Can you tell me the frequently used packages?
Java.io.*, java.util.*



8. Which collection type in Java? Can you explain the difference betweenthem?
Collection is implemented by List and Set interface. The biggest differencebetween them is that Set does not allow duplicated values but List allows.



9. Do you have any idea about Java thread? What is synchronized?
Yes, we can implement the Java thread in two ways. One is to implement theRunnable interface and the other one is to extends Thread class. If I need tochoose one of them in my application, I will choose to implement Runnableinterface, because we can implement multiple interfaces but only to extend oneClass.



10.   Have you use Intercept filter (通过Spring的拦截器实现filter的功能这块)

First ofall, we need to create an Interceptor and extends HandlerInterceptorAdapter,and overwrite a method to deal with operation (Methods: preHandle, postHandle,afterCompletion). After that, we also have to add related information into xmlto define our interceptor.

 

 

 

11.  Do you have any idea about Aspect(Spring)?
Aspect: A modularization of a concern for which the implementation mightotherwise cut across multiple objects. Transaction management is a good exampleof a crosscutting concern in J2EE applications. Aspects are implemented usingSpring as Advisors or interceptor

12. Doyou have any experience in Oracle? How to improve the efficiency of Oracle? Anyconcerns about Oracle Cache?



13. Can we define two databasesin one xml file for Hibernate?  How?



14. What is Hibernate Cache?



15. Any experience in file operation? How to check one file whether itexists? How to get content from a file?



16. What is primary key and Unique Key.

Both thekeys mean the value need be unique for this column in one table.

Thedifference is :


a.     Primary key can not has null value while uniquekey has.

b.     There is only one primary key in one tablewhile for unique key one table can contain multiple unique keys.


17. How do you understand Reflection?


18. Whatis Annotation? How do you use it?


19. Whatis design pattern? What kinds of design pattern you usually used?

In whatcase, you need a Singleton, in what case, you need a factory?


 

20. Whatis AJAX. How do you use it?

 


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值