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);
}
}
}>
> 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.
> 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 >

> 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"?
> 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...