当前位置: 代码迷 >> J2SE >> 初学java,碰到简单面试题:(,该怎么处理
  详细解决方案

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

热度:248   发布时间:2016-04-24 17:09:24.0
初学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.
  相关解决方案