Problem with Vector

I have a problem in my socket program(trying to implement sliding window algorithm). Details are given below:
I have declared a static member variable ServerWindow of type Vector in my socket program. I am adding all the packets receiving from the client
to this vector. But whenever I am trying to add a new packet, it simply overwrites all the records in the vector. So my vector when displayed
has the last packet for all elements. I have checked the received
packet and its contents are OK.
public void receive(DatagramPacket p) throws IOException {
boolean KeepRunning = true;
boolean KeepGoing = true;
ServerWindow = new Vector();
while(KeepRunning){
try{
while (KeepGoing){ 
if (ServerWindow.size() <= 7){
super.receive(p);
if (isCorrectCRC(p)){
ServerWindow.add(p);
if (ServerWindow.size() == 7){
for (i=0;i<ServerWindow.size();i++){
System.out.println("In receive(): " + i + " " + new String( (byte[])ServerWindow.get(i)));
}catch(SocketTimeoutException e){
} //end of catch
} // end of while
} // end of receive method

I think coz you keep redeclaring serverwindow in your method. Each time it creates a new Vector object.

Similar Messages

  • HELP-Problem with Vector type in Applet

    Hi,
    I am writing an Java applet which uses Vector. It won't run in IE browser, simply does not respond.
    However, when I tested the program using Appletviewer it runs prefectly.
    Is there a way to make Vector work in applet ?
    I have investigated the code and I'm pretty sure it's the Vector that causes problem in the applet.
    Pls your idea. Thanks.
    Hadi

    Hi,
    I use Applet, not JApplet. There are 3 deprecated things in this applet (mouseDown, keyDown, action) but I have used them all in my previous applet with no problem at all.
    I suspected the problem is Vector related by inserting several showDialogs as below:
    showDialog("1111");
    t.clear();     // to clear the vector
    showDialog("222222");
    I can see that the applet displays the 1111, but does not display 222222 at all. It seems like it simply ignores all commands after the first showDialog. Therefore, I suspect the t.clear() as the source of problem. But it does not display any error.
    't' is defined at the top as:
    static Vector t = new Vector();
    And t is manipulated by such: t.add(new Task()); and other regular Vector methods in jdk 1.3. I also checked that there is no deprecated methods for Vector from 1.2 to 1.3.
    I use MS Internet Explorer to run my applet.
    Any other things I should check ?
    Thanks.

  • Problems with vectors

    Hi,
    In response to an earlier problem i posted which i thought i had resolved i have to ask some more advice as i am still having problems.
    Basically i have two points (0,0,0) and (1,1,1) where two spheres are located, im trying to connect a cylinder to these spheres. I have tried using Pythagoras theorem and this connects the spheres up perfectly if the z value is assigned to 0 when i use the rotZ() method with the resulting angle. What i would like to know is there any way of connecting the spheres with 3 coordinates for x,y,z using the same method.
    The main formula i was working on was after connecting up the spheres in just 2 dimensions (ie z value equal to 0) as i mentioned earlier, was to calculate the length of the hypoteneus and have the z value divide this (ie using Pytagoras' theorem again tan teeta = z2-z1/c where c is the sqrt(x*x+y*y) ). Once i got this angle i then rotated it around the Y axis (im not sure if i am actually rotating it around the correct axis, i know that i also have to rotate around the X axis a certain degree but i dont know how much) however the spheres still did not connect up.
    Is it possible to do it the above way or do i need to do i need to use all vector calculations (dot, cross products etc) which i would prefer to stay away from?
    Sorry if it is not very clear it is kind of hard to explain!
    Any help would be greatly appreciated because it is really driving me nuts.
    Regards
    Andy

    Hi
    Just putting up the code to show how i am figuring out the angles and what rotations im using
              double tanTeetaXY = (y-0.0f)/(x-0.0f);
                   double teetaXY = Math.atan(tanTeetaXY);
                   double tanTeetaXZ = (z-0.0f)/(x-0.0f);
                   double teetaXZ = Math.atan(tanTeetaXZ);
                   double testang = (y-0.0f)/(z-0.0f);
                   double teetatest = Math.atan(testang);
                   rotate.rotZ((Math.PI/2.0f)-teetaXY);
                   temprotate.rotY(teetaXZ);
                   rotate.mul(temprotate);
                   temprotate.rotX(teetatest);
                   rotate.mulInverse(temprotate);
                   rotate.invert();Am i completely off with this or is there a better way to figure things out does anyone know? I just cant get my head around it!
    Much appreciated
    Andy

  • Problem with Vector method addElement

    I am new to Java. I am using JDK 1.3. I am writing a program that will convert a text file to a binary file that stores a Vector object. I have narrowed my problem to the method that reads the text file and creates my vector. Each element in my vector stores an integer and a string variable. The reading of the text file works find and the creation of my record works find. It seems that the storing of the record in the vector is not working. When I print the first 10 elements of the vector, it have the same record(the last record of my text file). What is wrong with the method below? I am also appending the result of running my program.
    private static void readTextFile(File f) {
    try {
    FileReader fileIn = new FileReader(f);
    BufferedReader in = new BufferedReader(fileIn);
    String line;
    int i;
    SsnLocationRecord recordIn = new SsnLocationRecord();
    int ctr = 0;
    while (true) {
    line = in.readLine();
    if (line == null)
    break;
    ctr += 1;
    i = line.indexOf(" ");
    recordIn.putAreaNumber(Integer.parseInt(line.substring(0,i).trim()));
    recordIn.putLocation(line.substring(i+1).trim());
    records.addElement(recordIn);
    if (ctr < 11)
    System.out.println(recordIn);
    in.close();
    } catch (IOException e) {
    System.out.println ("Error reading file");
    System.exit(0);
    for (int i = 0; i < 11; i++)
    System.out.println((SsnLocationRecord) records.elementAt(i));
    RESULTS:
    C:\Training\Java>java ConvertTextFileToObjectFile data\ssn.dat
    0 null
    3 New Hampshire
    7 Maine
    9 Vermont
    34 Massachusetts
    39 Rhode Island
    49 Connecticut
    134 New York
    158 New Jersey
    211 Pennsylvania
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    680 Nevada
    C:\Training\Java>

    First of all it would be better if you did a priming read and then checked line == null in the while statement instead of the way you have it.
    ctr++ will also accomplish what ctr +=1 is doing.
    you need to create a new instance of SsnLocationRecord for each line read. What you are doing is overlaying the objects data each time you execute the .putxxxx methods. The reference to the object is placed in the vector. The actual object is still being updated by the .putxxx methods (NOTE : THIS IS THE ANSWER TO YOUR MAIN QUESTION).
    you close should be in a finally statement.
    To process through all the elements of a Vector create an Enumeration and then use the nextElement() method instead of the elementAt is probably better. (Some will argue with me on this I am sure).
    Also, on a catch do not call System.exit(0). This will end your JVM normally. Instead throw an Exception (Runtime or Error level if you want an abnormal end).

  • Webservice Client deserialization problem with Vectors!

    Hello!
    I'm generating a Java Proxy Client with Eclipse WTP.
    The Client works fine with normal datatypes and own Beans. But whe the return type is a Collection with own beans an exception is thrown:
    exception: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    So whats wrong?
    In teh Webservice Explorer everything seems to be fine, my vector is serialized in item-tags:
    - <getAktionenResponse xmlns="http://commonservice">
    - <getAktionenReturn>
    - <item xmlns="">
    <aktn_nr>a12345</aktn_nr>
    <claim>222</claim>
    <geschaeftsjahr>2005</geschaeftsjahr>
    <son>333</son>
    <special_operation_code>soc12345</special_operation_code>
    <status>ready</status>
    <vin>t123</vin>
    </item>
    - <item xmlns="">
    <aktn_nr>a6789</aktn_nr>
    <claim>567</claim>
    <geschaeftsjahr>2006</geschaeftsjahr>
    <son>555</son>
    <special_operation_code>soc6789</special_operation_code>
    <status>false</status>
    <vin>t123</vin>
    </item>
    </getAktionenReturn>
    </getAktionenResponse>
    how can i solve this problem?
    the background is that I return a vector with Java Objects. I thought apache axis deserielizes automatically the vector and the bean inside??
    I'm pretty new to webservices...
    Pleas help!
    Thanks!

    As per the below link, I assumed its better to avoid collections and go with plain array of objects.
    Please let us know if I am wrong.
    http://www-128.ibm.com/developerworks/webservices/library/ws-tip-coding.html
    Regards,
    Venkat S

  • PROBLEM WITH VECTORS

    i NEED SOME HELP HERE. I HAVE TRIED DIFFERENT METHODS, BUT I CAN'T SEEM TO GET IT RIGHT
    int location = -1;///TODO: SET location = INDEX OF ITEM WITH A VALUE X
    list.remove(5);
    print("Item equal to 6 removed", list);
    ///TODO: ADD 9 TO LIST AT POSITION 2 AND ADD 123 TO END OF LIST
    list.add(new Integer (99));
    print("Added 44 at 4 and 99 at end", list);
    add1ToAll(list);
    print("1 added to each", list);
    static void print(String message, Vector v)
    System.out.print(message + ": {");
    for(int i = 0; i < v.size() - 1; i++)
    System.out.print(v.get(i) + ", ");
    System.out.println(v.get(v.size() - 1) + "}");
    static void add1ToAll(Vector v)
    ///TODO: ADD 1 TO EACH NUMBER IN VECTOR v

    1) are you using the (new Integer()); I think that there is a difference between Integer and int;
    2) I found that using a Vector with images is easier if you add it as a String like this (vector.add(""+foo));
    and then convert it back upon usage eg.
    int x = Integer.parseInt((String)vect.get());
    or something like that. I am not around my development
    enviroment at this time.
    --Ian                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • ReadObject and problems with Vector field

    hello.
    i'm trying to send an object(data Packet for a chat application) and receive it via sockets.
    every thing is right but there is a Vector field(online users list)that has some problems.
    my clients receive every updated class that contains new user list.but they just see the first received list?
    it's so strange to me because every thing else (such as color,font,size,..) works fine.
    can you help me?

    Every time you resend an object you have already sent, ObjectOutputStream will just send a 'handle', not the actual object. If it's changed value this is a problem. Use ObjectOutputStream.reset() to cause it to forget everything previously sent.

  • FW CS3 problem with Vector Images PLEASE HELP

    Hello,
    My name is Logan and I work for a company called Sutherland
    Design Agency. I am creating a website and i created some vector
    images in illustrator for the logo because i wanted source files to
    be imported into fireworks. When I imported the ai file it seemed
    to be rasterized. Is this normal?
    I would like my images to stay as vectors in fireworks so i
    decided to test this a couple times. When i create a vector i save
    it and import it into fireworks. It's a raster. Then i export it as
    an illustrator file and when i open it, it's a vector again. So i
    know that it is a vector, but why won't it show up in fireworks
    CS3.
    I also noticed the drop-down bar with the different image
    types. Is fireworks auto-optimizing? If so, is there a way to turn
    this off? I want to do my own optimization and I want to view the
    fireworks document the way it is.
    Much help would be greatly appreciated.
    Thanks,
    Logan
    Sutherland Design Agency

    Anagon wrote:
    > okay i'll try that and post my result here.
    >
    >
    FW CS3 should import your AI file without downsaving it to AI
    8. Keep in
    mind though, FW always displays vectors as they would appear
    when
    exported as bitmaps (browsers don't understand vector files
    without a
    helper application). If you are zooming in (not scaling) on
    the canvas,
    the artwork will start to look pixelated, because the stroke
    and fills
    are being displayed as bitmaps. Scaling the image should have
    no
    detrimental effect on the vector.
    Jim Babbage - .:Community MX:. & .:Adobe Community
    Expert:.
    http://www.communityMX.com/
    CommunityMX - Free Resources:
    http://www.communitymx.com/free.cfm
    .:Adobe Community Expert for Fireworks:.
    Adobe Community Expert
    http://tinyurl.com/2a7dyp
    See my work on Flickr
    http://www.flickr.com/photos/jim_babbage/

  • Problem with Vector.contains

    Hello,
    I wrote this code but it doens't work; but it should
    public class Word {
         public Word(String v) { _value = new String (v); }
         public Word() { _value ="";  }
         String _value = null;
         public boolean equals(Object obj) {
              if(this == obj)
                   return true;
              if((obj == null) || (obj.getClass() != this.getClass()))
                   return false;
              Word word = (Word)obj;
              return _value != null && _value.equals(word._value);                         
         public int hashCode() {
              int hash = 7;
              //hash = 31 * hash + num;
              hash = 31 * hash + (null == _value ? 0 : _value.hashCode());
              return hash;
    public class MyDictionary {     
         private Vector<Word> _words = new Vector<Word>();     
         Vector<Word> getWord() { return _words; }
    //other class
    MyDictionary dic = new MyDictionary();
                                    List< String > _testDoc = new ArrayList< String > ();
                                    //fill _testDoc
                                    Iterator<String> iter = _testDoc.iterator(); /
                                    for (int i=0; iter.hasNext(); i++ ) {
                               if ( dic.getWord().contains( new Word( iter.next() ) )) {
                                System.out.println("......................................");
                                     }I assure you (because I saw it) that _testDoc has words contained in dic; instes that if is never executed; probably I'm missing something simple....
    thanks
    Edited by: mickey0 on Aug 17, 2009 10:45 AM

    mickey0 wrote:
    Hello,
    I wrote this code but it doens't work; but it shouldIf it "doesn't work", then it's not supposed to work.
    mickey0 wrote:
    I assure you (because I saw it) that _testDoc has words contained in dic; instes that if is never executed; Can you post an SSCCE that shows this?
    mickey0 wrote:
    probably I'm missing something simple....This remark contradicts your earlier claim that it should work.

  • Problems using Vector in Flex Builder 3

    I've been using Vector with no problems in Flash Builder Beta, but when I try the same thing in Flex Builder 3, the compiler throws a fit when I use it. 
    public function PuzzleEvent(type:String, pieces:Vector.<Sprite>, bubbles:Boolean=false, cancelable:Boolean=false)
         //handle PuzzleEvent
    The other strange thing is, Flex automatically adds this line when I use vector:
    import __AS3__.vec.Vector;
    An import shouldn't be necessary should it?  Vector is in the top level package right?  With or without that import statement, I get compile errors.  Has anyone else had such problems with vector in Flex Builder?
    Dan

    The only way I was ever able to solve this problem was to use Flex builder Beta and now Flash Builder 4.  I did target flash player 10.0.0, but I still never could get it to work.  At least it works in Flash Builder 4.

  • Problems with inserting elements into vectors

    Hi,
    I have a problem with the setElementAt() method for vectors.
    I want to initialise a vector that is same size as a previous vector declared in my program and insert float 0.0 in all the positions.
    The code below is a for loop to do just this where count is the size of the previous vector.
    for(int i=0;i<count; i++)
                   vLargest.setElementAt(zero,i);
              }i have declared zero as a float
    float zero = 0.0f;
    the error that i'm getting is that it that the vector cannot be applied to a float.
    Can anybody tell me what i'm doing wrong?
    Thanks

    Yes you need to store Objects in your Vector not primitives.
    float is not an Object it is a primitive. But Float is an object.

  • Problem with String in a Vector

    I'm making a small hangman game. And I got a problem with putting words in a Vector... This is the code... Can someone tell me what I'm doing wrong?
    // First I define it.
    Vector Words;
    //  Then add the words
    Vector Words = new Vector();
    Words.add(new String("HELLO"));
    Words.add(new String("GOOD BYE"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0);

    Not sure since I cant see all of your code but looks like this might be your problem:
    // First I define it.
    Vector Words; //<-- here you define a Vector named Words that is null
    // Then add the words
    Vector Words = new Vector(); //<-- here you define another vector named Words that holds a reference to a new Vector. This is a different reference than the one created above so you should probably remove the "Vector" part from the beginning of this line. Is this a local variable to a method and the one before is a global variable?
    //Here you probably access the locally created Words vector which is initialized
    Words.add(new String("HELLO"));
    // When I try to get a string from the Vector I use this.
    // The program compiles but when I try to run it I get NullPointerExeption here
    W = (String) Words.elementAt(0); //<--and here my guess is that this statement is inside another method than the one with the local Words vector defined. Thus this one accesses the global Words Vector that is never initalized and is Null. And that gives you the NullPointerException.
    So try changing the statement
    Vector Words = new Vector();
    to
    Words = new Vector();
    or just remove it totally and move the Vector creation to the place where you introduce the global variable.
    Of course I might be totally wrong since I cant see all of your code but that is my guess.
    Hope it helps,
    -teka

  • Problem with filling up vector

    Hello,
    i'm having a problem with the following code; when i try to fill up the vector, it overwrites the previous values with the new, so the when i add the second item, the first item becomes the second too. So when i return the vector, all values are similar (the last).
    public Vector getClients(){
    Database singleton = Database.getDatabase();
    User user=new User();
    Vector clients = new Vector();
    try{
    singleton.openConnection();
    ResultSet rs = singleton.getResultSet("SELECT * FROM tblClients");
    while(rs.next()){
    user.setNaam(rs.getString("naam"));
                   user.setVoornaam(rs.getString("voornaam"));
                   user.setNickname(rs.getString("nickname"));
                   user.setEmail(rs.getString("email"));
                   user.setPaswoord(rs.getString("paswoord"));
    System.out.print("user added:" + user.getNickname() + "\n" );
    clients.add(user);
    System.out.println(user);
    singleton.closeConnection();
    }catch(SQLException sqle){
    sqle.getMessage();
    sqle.printStackTrace();
    System.out.print(clients.size() + " users added\n");
    return clients;
    }

    You are always adding the same user-Object to the Vector.
    You should put the command
    user=new User();inside the while-loop to have different objects for different users.

  • Strange Problem with a Vector wraped inside a Hashtable

    Hi all ,
    I'm having a strange problem with a Vector wraped within a Hashtable inherited Class.
    My goal is to keep the order of the elements of the Hashtable so what I did was to extend Hashtable and wrap a Vector Inside of it.
    Here is what it looks like :
    package somepackage.util;
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    public class OrderedHashTable extends Hashtable {
        private Vector index;
        /** Creates a new instance of OrderedHashTable */
        public OrderedHashTable() {      
            this.index = new Vector();
    //adds a key pair value to the HashTable and adds the key at the end of the index Vector
       public synchronized Object put(Object key,Object value){      
           index.addElement(key);
           Object obj = super.put(key,value);
           System.out.println("inside OrderedHashTable Put method index size = " + index.size());
           return obj;    
    public synchronized Object remove(Object key){
           int indx = index.indexOf(key);
           index.removeElementAt(indx);
           Object obj = super.remove(key);
           return obj;
    public synchronized Enumeration getOrderedEnumeration(){
           return index.elements();
    public synchronized Object getByIndex(int indexValue){
           Object obj1 = index.elementAt(indexValue);
           Object obj2 = super.get(obj1);      
           return obj2;
       public synchronized int indexOf(Object key){
        return index.indexOf(key);
        public synchronized int getIndexSize() {
            return index.size();
        }Everything seemed to work fine util I tried to add objects using a "for" loop such as this one :
    private synchronized void testOrderedHashTable(){
            OrderedHashTable test = new OrderedHashTable();
            for (int i = 1 ; i<15; i++){
                 System.out.println("adding Object No " + i);
                 String s = new String("string number = "+i);
                 test.put(new Integer(i),s);
                 System.out.println("-----------------------------------");
            //try to list the objects
            Enumeration e = test.getOrderedEnumeration();
            while (e.hasMoreElements()){
                Integer intObj = (Integer) e.nextElement();
                System.out.println("nextObject Number = "+ intObj);
        }Here is the console output :
    Generic/JSR179: adding Object No 1
    Generic/JSR179: inside OrderedHashTable Put method index size = 1
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 2
    Generic/JSR179: inside OrderedHashTable Put method index size = 2
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 3
    Generic/JSR179: inside OrderedHashTable Put method index size = 3
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 4
    Generic/JSR179: inside OrderedHashTable Put method index size = 4
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 5
    Generic/JSR179: inside OrderedHashTable Put method index size = 5
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 6
    Generic/JSR179: inside OrderedHashTable Put method index size = 6
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 7
    Generic/JSR179: inside OrderedHashTable Put method index size = 7
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 8
    Generic/JSR179: inside OrderedHashTable Put method index size = 8
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 9
    Generic/JSR179: inside OrderedHashTable Put method index size = 10
    Generic/JSR179: inside OrderedHashTable Put method index size = 10
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 10
    Generic/JSR179: inside OrderedHashTable Put method index size = 11
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 11
    Generic/JSR179: inside OrderedHashTable Put method index size = 12
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 12
    Generic/JSR179: inside OrderedHashTable Put method index size = 13
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 13
    Generic/JSR179: inside OrderedHashTable Put method index size = 14
    Generic/JSR179: -----------------------------------
    Generic/JSR179: adding Object No 14
    Generic/JSR179: inside OrderedHashTable Put method index size = 15
    Generic/JSR179: -----------------------------------
    Generic/JSR179: nextObject Number = 1
    Generic/JSR179: nextObject Number = 2
    Generic/JSR179: nextObject Number = 3
    Generic/JSR179: nextObject Number = 4
    Generic/JSR179: nextObject Number = 5
    Generic/JSR179: nextObject Number = 6
    Generic/JSR179: nextObject Number = 7
    Generic/JSR179: nextObject Number = 8
    Generic/JSR179: nextObject Number = 9
    Generic/JSR179: nextObject Number = 9
    Generic/JSR179: nextObject Number = 10
    Generic/JSR179: nextObject Number = 11
    Generic/JSR179: nextObject Number = 12
    Generic/JSR179: nextObject Number = 13
    Generic/JSR179: nextObject Number = 14
    You can notice that the output seems correct until the insertion of object 9.
    At this point the vector size should be 9 and the output says it is 10 elements long ...
    In the final check you can notice the 9 was inserted twice ...
    I think the problem has something to do with the automatic resizing of the vector but I'm not really sure. Mybe the resizing is done in a separate thread and the new insertion occurs before the vector is resized ... this is my best guess ...
    I also tested this in a pure J2SE evironment and I don't have the same strange behavior
    Can anybody tell me what I am doing wrong or how I could avoid this problem ?
    Thanks a lot !
    Cheers Alex

    Am i doing anything wrong?Uhm, yes. Read the API doc for addElement() and for addAll()

  • Vector, what is the problem with this code?

    Vector, what is the problem with this code?
    63  private java.util.Vector data=new Vector();
    64  Vector aaaaa=new Vector();
    65   data.addElement(aaaaa);
    74  aaaaa.addElement(new String("Mary"));on compiling this code, the error is
    TableDemo.java:65: <identifier> expected
                    data.addElement(aaaaa);
                                   ^
    TableDemo.java:74: <identifier> expected
                    aaaaa.addElement(new String("Mary"));
                                    ^
    TableDemo.java:65: package data does not exist
                    data.addElement(aaaaa);
                        ^
    TableDemo.java:74: package aaaaa does not exist
                    aaaaa.addElement(new String("Mary"));Friends i really got fed up with this code for more than half an hour.could anybody spot the problem?

    I can see many:
    1. i assume your code snip is inside a method. a local variable can not be declare private.
    2. if you didn't import java.util.* on top then you need to prefix package on All occurance of Vector.
    3. String in java are constant and has literal syntax. "Mary" is sufficient in most of the time, unless you purposly want to call new String("Mary") on purpose. Read java.lang.String javadoc.
    Here is a sample that would compile...:
    public class QuickMain {
         public static void main(String[] args) {
              java.util.Vector data=new java.util.Vector();
              java.util.Vector aaaaa=new java.util.Vector();
              data.addElement(aaaaa);
              aaaaa.addElement(new String("Mary"));
    }

Maybe you are looking for

  • How would I create a Summary Chart for the Current Year Using a Count by Month?

    Post Author: MarkS CA Forum: Charts and Graphs I have a data set of 3 date fields.  I would like to create a summary counting all of the occurrances of each of these dates per month, similar to using a SumProduct() command in excel. For example, my d

  • Error; publication terminated = Content Could not be Read

    Hello All,   It is getting insanely painful. We are replicating our catalog. which is massive 10000 products, 8000 images tons of attributes etc. the project is CRM 2007 Web Channel and we are using TREX 7.1. I am getting the below error Error; publi

  • Does anybody know how to change the title of your podcast on iTunes and the description of it?

    I was working on my feed site and when the podcast popped up on iTunes I realized that I put the wrong info and title on it. Anybody know?

  • 2010 workflow support

    Hi,  Is there any official communication on support for SharePoint 2010 workflow platform in SP 2013 edition. Basically, how by when we should migrate (recreate) 2010 workflows in 2013 (WFM). Any clarification will be very helpful. Thanks.  regards S

  • Fails to open

    Simply put. One day Mail decided not to open and continues to not open. I click the icon, the force quit menu says it's running, but there's no window and the only way I can interact with it is to force quit it. Is there a way to fix this?