genrate csv file forse close android
hi friends i am generating csv file and it force close why pls check it out and help me..
my code is   




       package contactlist.pkg;

           import java.io.FileWriter;
           import java.io.IOException;
 
         public class GenerateCsv
       {
     public static void main(String [] args)
     {
	   generateCsvFile("C:\\test.csv"); 
     }
  
       private static void generateCsvFile(String sFileName)
       {
	 try
	  {
	    FileWriter writer = new FileWriter(sFileName);
 
	    writer.append("DisplayName");
	    writer.append(',');
	    writer.append("Age");
	    writer.append('\n');
 
	    writer.append("MKYONG");
	    writer.append(',');
	    writer.append("26");
            writer.append('\n');
 
	    writer.append("YOUR NAME");
	    writer.append(',');
	    writer.append("29");
	    writer.append('\n');
 
	    //generate whatever data you want
 
	    writer.flush();
	    writer.close();
	}
	catch(IOException e)
	{
	     e.printStackTrace();
	} 
       }
    }

  errors are   



       07-27 13:12:30.508: ERROR/AndroidRuntime(939): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{contactlist.pkg/contactlist.pkg.GenerateCsv}: java.lang.ClassCastException: contactlist.pkg.GenerateCsv
       07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
        07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
          07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.os.Handler.dispatchMessage(Handler.java:99)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.os.Looper.loop(Looper.java:123)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.main(ActivityThread.java:3683)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at java.lang.reflect.Method.invokeNative(Native Method)
           07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at java.lang.reflect.Method.invoke(Method.java:507)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
          07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
             07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at dalvik.system.NativeStart.main(Native Method)
               07-27 13:12:30.508: ERROR/AndroidRuntime(939): Caused by: java.lang.ClassCastException: contactlist.pkg.GenerateCsv
             07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
           07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)

genrate csv file forse close android
===

hi friends i am generating csv file and it force close why pls check it out and help me..
my code is   




       package contactlist.pkg;

           import java.io.FileWriter;
           import java.io.IOException;
 
         public class GenerateCsv
       {
     public static void main(String [] args)
     {
	   generateCsvFile("C:\\test.csv"); 
     }
  
       private static void generateCsvFile(String sFileName)
       {
	 try
	  {
	    FileWriter writer = new FileWriter(sFileName);
 
	    writer.append("DisplayName");
	    writer.append(',');
	    writer.append("Age");
	    writer.append('\n');
 
	    writer.append("MKYONG");
	    writer.append(',');
	    writer.append("26");
            writer.append('\n');
 
	    writer.append("YOUR NAME");
	    writer.append(',');
	    writer.append("29");
	    writer.append('\n');
 
	    //generate whatever data you want
 
	    writer.flush();
	    writer.close();
	}
	catch(IOException e)
	{
	     e.printStackTrace();
	} 
       }
    }

  errors are   



       07-27 13:12:30.508: ERROR/AndroidRuntime(939): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{contactlist.pkg/contactlist.pkg.GenerateCsv}: java.lang.ClassCastException: contactlist.pkg.GenerateCsv
       07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
        07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
          07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.os.Handler.dispatchMessage(Handler.java:99)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.os.Looper.loop(Looper.java:123)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.main(ActivityThread.java:3683)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at java.lang.reflect.Method.invokeNative(Native Method)
           07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at java.lang.reflect.Method.invoke(Method.java:507)
         07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
          07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
             07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at dalvik.system.NativeStart.main(Native Method)
               07-27 13:12:30.508: ERROR/AndroidRuntime(939): Caused by: java.lang.ClassCastException: contactlist.pkg.GenerateCsv
             07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
           07-27 13:12:30.508: ERROR/AndroidRuntime(939):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
