Your code isn't correct.
String name[] = new String[30];
but you wrote: name[30] = JOptionPane.showInputDialog( "Please enter your full 
name" );
but the index of array starts with 0 to 29. so you have to write name[29].
Please read more about array. 

Thanks 
Hussein 




________________________________
From: sonam dalal <[email protected]>
To:     
Sent: Tuesday, September 8, 2009 8:49:02 PM
Subject: [java programming] Javaintro-Java Array Homework

  Hey all!

i'm having a little bit of a problem with the java array homework
First i tried to just start off by take string input with JOptionPane, but it 
is showing error while printing the input
my program is as follows:
import javax..swing.JOptionPane;
/**
 *
 * @author SONAM DALAL
 */
public class JavaArray {
    public JavaArray(){
    }

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
        String name[]=new String[30];
        name[30]=JOptionPane.showInputDialog("Enter your full name");
        String msg="Hello "+name+"!!!" ;
        JOptionPane.showMessageDialog(null,msg);
    }

}


Also how do you you use the split concept to print first name separately?
This homework is kinda confusing!!

Thanks a lot!

________________________________
Match ā€˜n’ Make new friends with the cool match-meter. Join the Planet with you 
Hotmail ID. Drag n’ drop


      
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to