![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java要点
chenshunlong
这个作者很懒,什么都没留下…
展开
-
java synchronized详解
Java语言的关键字,当它用来修饰一个方法或者一个代码块的时候,能够保证在同一时刻最多只有一个线程执行该段代码。 一、当两个并发线程访问同一个对象object中的这个synchronized(this)同步代码块时,一个时间内只能有一个线程得到执行。另一个线程必须等待当前线程执行完这个代码块以后才能执行该代码块。 二、然而,当一个线程访问object的一个synchro转载 2016-09-01 14:51:30 · 208 阅读 · 0 评论 -
Spring注解@Component、@Repository、@Service、@Controller区别
Spring注解@Component、@Repository、@Service、@Controller区别Spring 2.5 中除了提供 @Component 注释外,还定义了几个拥有特殊语义的注释,它们分别是:@Repository、@Service 和 @Controller。在目前的 Spring 版本中,这 3 个注释和 @Component 是等效的,但是从注释类的命名上,转载 2016-09-01 15:46:05 · 258 阅读 · 0 评论 -
java中PING IP地址
public static void main(String [] args){ Runtime runtime = Runtime.getRuntime(); // 获取当前程序的运行进对象 Process process = null; // 声明处理类对象 String line = null; // 返回行信息转载 2016-09-01 16:00:34 · 615 阅读 · 0 评论