读书人

初学java碰到简单面试题:(,该怎么

发布时间: 2012-02-01 16:58:19 作者: rapoo

初学java,碰到简单面试题:(
how to answer following questions in english:

1.How to lock thread resources in java?

2.please give a example of MVC implementation?

[解决办法]
1.synchronized(this)
2.Struts WebWork Spring
[解决办法]
1.synchronized
2.struts MVC
[解决办法]
synchronized(this);
wait();

Struts Spring WebWork
[解决办法]
题1:
The Java programming language does not provide a way to perform separate lock and unlock actions; instead, they are implicitly performed by high-level constructs that arrange always to pair such actions correctly.
however, that the Java virtual machine provides separate monitorenter and monitorexit instructions that implement the lock and unlock actions.
题2:
Spring、Struts、Eclipse are all the implementations of the MVC pattern.

读书人网 >J2SE开发

热点推荐