Bookmark Topic Watch Topic
  • New Topic

problem different from c++

 
sheng zhong
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Report post to moderator
import java.util.*;
public class test {

public static void main(String args[]){

Vector<Vector<Double>> Stree = new Vector<Vector<Double>>();
Vector<Double> Svec = new Vector<Double>();

Svec.add(100.0);
Stree.add(Svec);
Svec.add(200.0);
Stree.add(Svec);


System.out.println("Stree 0 is "+Stree.get(0));
System.out.println("Stree 1 is "+Stree.get(1));
}
}


How can I get the result like this as C++:

Stree 0 is [100.0]
Stree 1 is [100.0, 200.0]
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please don't ask the same question twice
 
    Bookmark Topic Watch Topic
  • New Topic