LifeMichael

LifeMichael

Haim Michael Blog

LifeMichael RSS Feed
 
 
 
 

Exceptions in Java and Threads PRO

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 IdeaPad Windows 7 Based Tablet INFO

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 Android Tablet INFO

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.

My .NET Professional Blog INFO

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.

Protected: Starhome Java Course (Logtel) INFO

This post is password protected. To view it please enter your password below:


Protected: Android Private Course (Logtel) INFO

This post is password protected. To view it please enter your password below:


Protected: Android Private Course (One1) PRO

This post is password protected. To view it please enter your password below:


Windows Phone 7 Fundamentals PRO

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.

The topics currently covered include the following:
Introduction
User Interface
Isolated Storage
WebBrowser Control
Application Bar
Location Services
Accelerometer
Security

More info about the commercial full version of this course can be found at www.xperato.com.

HTC Android Mobile Telephones INFO

I have recently found few short video clips that present HTC few of their currently offered android based mobile telephones models. I hope you enjoy.

HTV Legend

HTC Wildfire

HTC Desire

HTC EVO 4G

People of Lava Google TV INFO

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″.

Categories

Communities

Archives

Tags

.NET Ajax Android Bible C# CSS diet eBook Games google J2ME Jacado Java Java EE Java ME JavaScript Joomla jQuery microsoft Mobizex mobosms Ness open source PHP quotes Reflection Regular Expression Scala Security Sidekick SMS SoaML SysML T-Mobile Technion testing Threads UML UNC Health Care Web Services Windows Phone 7 WP7 XHTML XML Zindell Technologies

Technorati

Add to Technorati Favorites

Recommend

ClustrMaps

FeedJIT

Google Page Rank

Alexa Stats