error in prog

hi every1!!!!!!!..........m new to java programming......

following is d prog vich i hav written on eclipse SDK.......nd getting d error

"Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2 > 0

at java.util.Vector.insertElementAt(Unknown Source)

at LanguageVector.main(LanguageVector.java:10)"........

plz cn anybody help me.......how to supply command line arguements to d prog?

import java.util.*;

class LanguageVector {

public static void main(String args[]) {

Vector list=new Vector();

int length=args.length;

for(int i=0;i<length;i++){

list.addElement(args);

}

list.insertElementAt("cobol",2);

int size=list.size();

String listArray[]=new String[size];

list.copyInto(listArray);

System.out.println("list of languages");

for(int i=0;i<size;i++)

{

System.out.println(listArray);

}

}

}>

[984 byte] By [mukta_guptaa] at [2007-11-27 6:53:02]
# 1
java LanguageVector fortran c java
kevjavaa at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 2
> .how to supply command line arguements to d prog?$java LanguageVector here are the command line arguments
Hippolytea at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 3
hey.....thanx 4 dose who hav answered to my query.........bt actually i wanna know whr to write dis java vector..nd so on......statement.in eclipse SDK........whn i run d prog by run as java application......directly d error vich i hav mentiond in my previous post is
mukta_guptaa at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 4

> hey.....thanx 4 dose who hav answered to my

> query.........bt actually i wanna know whr to write

> dis java vector..nd so on......statement.

> in eclipse SDK........whn i run d prog by run as java

> application......directly d error vich i hav mentiond

> in my previous post is displayed......

If you desire an answer in english, please rephrase your question in english. Know that for many folks reading these forums, English is a second language, and they are not able to understand abbreviations. For the rest of us, trust me, you want to make it as easy as possible to understand you. That means minimal abbreviations and the proper use of code tags.

petes1234a at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 5

> hey.....thanx 4 dose who hav answered to my

> query.........bt actually i wanna know whr to write

> dis java vector..nd so on......statement.

> in eclipse SDK........whn i run d prog by run as java

> application......directly d error vich i hav mentiond

> in my previous post is displayed......

Please use proper English with proper spelling, punctuation, grammar, and capitalization. I refuse to read any of that nonsense.

jverda at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 6
list.addElement(args);should be:list.addElement(args[i]);
petes1234a at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 7
> list.addElement(args);> > should be:> > list.addElement(args[i]);I think it would have been, if he had used [code] tags (note the original italics).
Hippolytea at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 8
> I think it would have been, if he had used [code]> tags (note the original italics).Ah, good pick up. My bad.
petes1234a at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 9

> hey.....thanx 4 dose who hav answered to my

> query.........bt actually i wanna know whr to write

> dis java vector..nd so on......statement.

> in eclipse SDK........whn i run d prog by run as java

> application......directly d error vich i hav mentiond

> in my previous post is displayed......

What on earth is "d" supposed to mean? Please tell me you're not thinking that "the" is pronounced "dee" and that you are abbreviating "dee" with "d". Please, please tell me.

"4 dose": I love it. "Dose"? How rich.

Why would you not spell out "this" ("dis"), "when" ("whn"), "have" ("hav"), yet spell out "statement", "previous", and "displayed"?

Djaunla at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...
# 10
> Why would you not spell out "this" ("dis"), "when"> ("whn"), "have" ("hav"), yet spell out "statement",> "previous", and "displayed"?If it looks like a troll, smells like a troll, and quacks like a troll...
petes1234a at 2007-7-12 18:27:43 > top of Java-index,Java Essentials,New To Java...