2013年9月8日

Exceptions Interview Questions

摘要: Exceptions Interview QuestionsQ1) What is an Exception?Ans) The exception is said to be thrown whenever an exceptional event occurs in java which signals that something is not correct with the code written and may give unexpected result. An exceptional event is a occurrence of condition which alters 阅读全文

posted @ 2013-09-08 14:40 brave_bo 阅读(327) 评论(0) 推荐(0)

死锁问题详解

摘要: synchronized 关键字,代表这个方法加锁,相当于不管哪一个线程A每次运行到这个方法时,都要检查有没有其它正在用这个方法的线程B(或者C D等),有的话要等正在使用这个方法的线程B(或者C D)运行完这个方法后再运行此线程A,没有的话,直接运行它包括两种用法:synchronized 方法和 synchronized 块。 1. synchronized 方法: 通过在方法声明中加入 synchronized关键字来声明 synchronized 方法。如: publicsynchronizedvoid accessVal(int newVal); synchronized ... 阅读全文

posted @ 2013-09-08 14:29 brave_bo 阅读(261) 评论(0) 推荐(0)

implement singleton

摘要: Two way to implement singleton patternpostedSep 12, 2011, 1:35 PMby Akrem AYADI [updatedSep 12, 2011, 2:00 PM]You find bellow the two ways to implemen... 阅读全文

posted @ 2013-09-08 14:29 brave_bo 阅读(315) 评论(0) 推荐(0)

导航