The Array is static one we cannot alter the size after the declaration.
The ArrayList is the dynamic one, it can modify its size based on the elements.
The ArrayList Size are 0,16,32,64.... For example initially its have 0 size if u add one element in the ArrayList it will increase the ArrayList size to 16. when the total elements increase to 17 the size of the ArrayList will be increased to 32.like that its modify its size dynamically depend on the element size.
The ArrayList is the dynamic one, it can modify its size based on the elements.
The ArrayList Size are 0,16,32,64.... For example initially its have 0 size if u add one element in the ArrayList it will increase the ArrayList size to 16. when the total elements increase to 17 the size of the ArrayList will be increased to 32.like that its modify its size dynamically depend on the element size.
Immutable String
An object qualifies as being called immutable if its value cannot be modified once it has been created. For example, methods that appear to modify a String actually return a new String containing the modification. Developers are modifying strings all the time in their code. This may appear to the developer as mutable - but it is not. What actually happens is your string variable/object has been changed to reference a new string value containing the results of your new string value. For this very reason .NET has the System.Text.StringBuilder class. If you find it necessary to modify the actual contents of a string-like object heavily, such as in a for orforeach loop, use the System.Text.StringBuilder class.
DataSet vs DataReader
Points to be consider while choosing between the DataSet and DataReader objects.
1) DataSet Object has Read/Write access, While DataReader Object has Read-only access
2) DataSet Object Supports multiple tables from different databases, While DataReader Object Supports a single table based on a single SQL query of one database
3) DataSet Object works under Disconnected mode, While DataReader Object has Connected mode
4) DataSet Object is Bind to multiple controls, While DataReader Object is Bind to a single control
5) DataSet Object supports Forward and backward scanning of data, While DataReader Object supports Forward-only scanning of data
6) DataSet Object has Slower access to data, While DataReader Object has Faster access to data
7) DataSet Object has Greater overhead to enable additional features, While DataReader Object being Lightweight object with very little overhead
8) DataSet Object is Supported by Visual Studio .NET tools, While DataReader Object Must be manually coded
No comments:
Post a Comment