Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Frankie Adams   on Jul 05 In Java Category.

  
Question Answered By: Jean Bell   on Jul 05

improved code:

import java.*;
import java.util.*;


public class  prova{

public static  void main(String args[]){

Integer arr1[]=new Integer[2];
Integer arr2[]=new Integer[2];
Vector vettore=new Vector();
vettore.addElement(arr1);
arr2=(Integer[]) vettore.elementAt(0);
}
}

> What is the right manner to do it working? and why.
Casting is done when you take something out of a Vectro because
Vectors only store Objects handles. The other method calls were just
wrong. Oh and vectors start counting their elements at 0.

Share: 

 

This Question has 1 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on Why it doesn't work? (use o Vector) Or get search suggestion and latest updates.


Tagged: