where you compile this code???? i compile it with netbeans 6.5 and it is SUCCESSFUL and run this is the result:
run: You must enter at least three names!!! Names of the family members are The new name is BUILD SUCCESSFUL (total time: 0 seconds) On Mon, Jan 12, 2009 at 3:43 PM, Ahmet Süreyya Rifaioğlu < [email protected]> wrote: > Hi members, > I wrote the homework of Built in Classes, but there is a problem in my > function(Exception in thread "main" java.lang.NullPointerException at > BuiltinClasses.generateNewName(BuiltinClasses.java:35) at > BuiltinClasses.main(BuiltinClasses.java:27)). Here is my code. > public class BuiltinClasses { > > /** > * @param args the command line arguments > */ > public static void main(String[] args) { > // TODO code application logic here > if(args.length<3) > { > System.out.println("You must enter at least three names!!!"); > } > System.out.println("Names of the family members are "); > for(int i=0;i<args.length;i++) > { > System.out.println(args[i]); > } > generateNewName(args); > } > public static void generateNewName(String arr[]) > { > System.out.println("The new name is "); > char[] newName = null; > for (int i=0;i<arr.length;i++) > { > newName[i]=arr[i].charAt(1); > System.out.print(newName[i]); > } > } > > } > > Regards > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en -~----------~----~----~----~------~----~------~--~---
