Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 601
  • Last Modified:

vector

what is the equivalent of vector in java to c#?
0
DWR200
Asked:
DWR200
2 Solutions
 
paddycobbettCommented:
Please rephrase the question? What is the c# equivalent of a java vector? Or the other way round?
0
 
DWR200Author Commented:
i want to convert from java to C#. which i need to know what is vector in c#.
0
 
paddycobbettCommented:
A vector is c#: System.Collections.ArrayList

=)
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 
doraemon-nolifeCommented:
The main difference between ArrayList and Vector is that Vector is thread safe but not for ArrayList.

The vector object in java is defaulted to be synchronized. To guarantee the thread safe features.

Basically, ArrayList in java and C# is the same and there is no Vector in C#

To achieve the same effect, you would need to do the primitive synchronization

Check this site to prove what i said it true.
http://msdn2.microsoft.com/en-us/library/system.collections.arraylist.aspx

Note:
1. Manual synchronization requires careful coding, else it would give you more problem.

2. Synchronization is a performance hit, think twice before you use it.

:)



0
 
paddycobbettCommented:
If the java.util.List functionality is what you need then System.Collections.ArrayList will suffice, if you need synchronization on individual elements is what you need then please specify that =)
0
 
Computer101Commented:
Forced accept.

Computer101
EE Admin
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now