When a specific method throws an Exception that isn’t handheld the exception is passed over to the method from which that specific method was called. If that other method doesn’t handle the exception the exceptions is passed over to the previous method and so on. Eventually, the thrown exception reaches the primary method of the thread in which the code is executed.
The primary method might be the method main, when dealing with the main thread of each and every Java application or the method run, when dealing with a new thread we created in our program. If the primary method doesn’t handle the exception then the thread in which the exception was thrown stops. The other threads continue. The following code sample shows that.
public class Mosko implements Runnable
{
int number;
public Mosko(int number)
{
this.number = number;
}
@Override
public void run()
{
for(int i=1; i<number; i++)
{
System.out.println(”ping “+i+” thread name is “+Thread.currentThread().getName());
try
{
Thread.sleep(1000);
}
catch(InterruptedException e)
{
e.printStackTrace();
}
}
throw new MyException();
}
}
public class MyException extends RuntimeException
{ }
public class MoskoDemo
{ /**
* @param args
*/
public static void main(String[] args) throws MyException
{
// TODO Auto-generated method stub
new Thread(new Mosko(4)).start();
new Thread(new Mosko(8)).start();
new Mosko(12).run();
}
}
The following video clip shows the execution of this code sample.
The Lenovo Ideapad U1 is the first hybrid notebook in the world. It can functions both as a notebook and a tablet. It runs on the Windows 7 operating system. The applications developed for this tablet are the same applications developed for any personal computer running on the Windwos 7 operating system.
The iRobot Group company offers an android based table for $200 (shipping included). They sell it from their web site directly. I am thinking about buying one. If you happen to have any experience buying this tablet from this company I will be more than happy to get your feedback.
I have recently started running a new blog dedicated for the .NET framework. The www.LifeMichael.com blog will continue to be the main one, and each and every post I publish in the new .NET framework blog will be published here as well.
Following my experience with the .NET framework during the last 4 years, I have no doubt my new .NET professional blog sets a new path in my professional life.
I have just completed to develop the first version of the my ‘Windows Phone 7 Fundamentals’ course. This course is available for free personal and academic usage at www.abelski.com. During the coming weeks I will continue to develop this course and add many more topics, concurrently with the release of additional technical documents from Microsoft.
People of Lava, a scandinavian company, seems to be the first company to release an android based television. According to their web site the first models will be with the following screen sizes: 42″, 47″ and 55″.
WordPress Basics. New course! Learn how to develop and maintain your own blog. No need in programming background! http://bit.ly/dhZwbK http://twitter.com/xperato