473,322 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

What do you mean by string vector

i want to know the detail of vector and where it implemented,and something in collections please reply and also iam want to know the popular site for learning jsp and stuts otherthan java site
Nov 28 '07 #1
3 1699
r035198x
13,262 8TB
i want to know the detail of vector and where it implemented,and something in collections please reply and also iam want to know the popular site for learning jsp and stuts otherthan java site
Here's the best page to get info about the Vector.
Pay special attention to the line which says
Unlike the new collection implementations, Vector is synchronized.
and make an effort to try and understand what it means and the implications.
Nov 28 '07 #2
pjerald
77
Here's the best page to get info about the Vector.
Pay special attention to the line which says
and make an effort to try and understand what it means and the implications.
Correct me please!!
Here i understand the following things.
1) It is not recommended to use Enumeration(Since it does not have fail-fast behaviour -- Actually i don know this fail-fast).
2) We can use Iterator since it will fail-fast! But it might throw "ConcurrentModificationException".
3) I don understand this "the fail-fast behavior of iterators should be used only to detect bugs."
4) "It is possible to modify collections (all collection class objects) other than Vector Object concurrently " -- is it true ?

Thanks,
P.Jerald
Nov 28 '07 #3
JosAH
11,448 Expert 8TB
Correct me please!!
Here i understand the following things.
1) It is not recommended to use Enumeration(Since it does not have fail-fast behaviour -- Actually i don know this fail-fast).
2) We can use Iterator since it will fail-fast! But it might throw "ConcurrentModificationException".
3) I don understand this "the fail-fast behavior of iterators should be used only to detect bugs."
4) "It is possible to modify collections (all collection class objects) other than Vector Object concurrently " -- is it true ?

Thanks,
P.Jerald
Fail fast behaviour is failing to iterate over a Collection as soon as is discovered
that the Collection has been changed 'behind the back' of the iterator. Further
iterations most likely result in garbage.

The implementation is quite lean and mean: both the Collection and the iterator
keep a modification count. When the Collection is updated behind the iterator's
back, the Collection's modification count is incremented. When the iterator has
to iterate one more step it compares both modification counts; if they're not
equal that Exception is thrown. Modifying the Collection using the iterator itself
increments both modification counts.

Modifying a Collection behind an iterator's back is considered not done and a bug.

A Vector uses synchronized methods for the add, delete etc. methods so no
two modifications can occur at the same time.

kind regards,

Jos
Nov 28 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Matthew | last post by:
I am working on a simple text adventure game. I have implemented one word commands and a bit for two words. I have a problem though the movement commands n and s (north and south respectivly) don't...
12
by: Steven T. Hatton | last post by:
This is something I've been looking at because it is central to a currently broken part of the KDevelop new application wizard. I'm not complaining about it being broken, It's a CVS images. ...
10
by: Steven T. Hatton | last post by:
I read Stroustrup's article of the day: http://www.research.att.com/~bs/C++.html Programming with Exceptions. InformIt.com. April 2001. http://www.research.att.com/~bs/eh_brief.pdf Some of...
6
by: Alfonso Morra | last post by:
I have written the following code, to test the concept of storing objects in a vector. I encounter two run time errors: 1). myClass gets destructed when pushed onto the vector 2). Prog throws a...
16
by: Khuong Dinh Pham | last post by:
I have the contents of an image of type std::string. How can I make a CxImage object with this type. The parameters to CxImage is: CxImage(byte* data, DWORD size) Thx in advance
32
by: Protoman | last post by:
I have a function that calculates the mean of the some numbers; I need it to accept any number of parameters (one needs to be the number of the other parameters) Can you help me out here? Here's...
5
by: pkirk25 | last post by:
It looks like the Visuakl Studio Intellisense can see the various functions but its compiler cannot. I am well out of my depth with this error message. report.obj : error LNK2019: unresolved...
12
by: blangela | last post by:
Someone has asked me what the relationship is, if any, between iostream and the STL. My suspicion is that iostream uses some of the functionality provided by the STL, but I have no actual kowledge...
10
by: Shafik | last post by:
Hello, I am new to C++. I know the reason is probably template instantiation problems ... but what's the *real* reason I cannot declare a: vector<stringv = vector<string>(4); Thanks!...
2
by: Lambda | last post by:
The code is simple: // Token.h #ifndef TOKEN_H #define TOKEN_H #include <vector> #include <string> class Token
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.