1. Exceptions – Meaning
2. Runtime Error – Groups – Exception causes
3. Exception Handling: try – catch
4. try – catch – finally
5. Hierarchy of Exceptions – Checked/Unchecked Exceptions
6. Throwing with "throws" – Alternative to try-catch
7. Creating User-defined Exceptions – throw Keyword
8. getMessage() & printStackTrace()
9. Try – Finally (without Catch)
10. Rules of Exceptions in Method Overriding
Some commonly occurring exceptions, elaborately discussed.
public void run(){
for(int i=1;i<5;i++){
try{Thread.sleep(500);}catch(InterruptedException e){System.out.println(e);}
System.out.println(i);
}
}
public static void main(String args[]){
TestCallRun2 t1=new TestCallRun2();
TestCallRun2 t2=new TestCallRun2();
t1.run();
t1.start();
t2.start();
}
}
in this program pl explain the difference between t1.start();and t1.run();?
what they actually does?
Every thread has a life cycle (4 states exist) maintained by JVM like getting into dead state when the job of the thread is over. If you call run() method, the life cycle is not taken care of. There may not be difference in output, but many internal things do not happen what a thread is eligible.
Thankx
sir,i didn’t find any search result on “assertion”. please,send me the url.
http://way2java.com/java-versions-2/jdk-1-4-j2se-4-version/
sir, NullPointerException?
Open this link:
http://way2java.com/exceptions/nullpointerexception/