Find jobs | Jobseekers
Employer login
About us Sitemap of www.CareerRide.com Sitemap FAQ related with www.CareerRide.com FAQ Click here to Contact us Contact
       
Submit Resume Free ! | Access Resume Free !
Home Career Services Resume Services Interview questions Articles Books
Content
NET framework
NET assembly
NET code security
NET access modifiers
NET architecture
NET base class library
NET CLR
NET constants,enum,arrays
NET data types
NET menu
NET garbage collection
NET debug and trace
NET properties
NET form
NET assemblies & resources
NET class & structures
NET binding,viewing,filtering
NET configuring & optimizing
NET configuring setup project
NET constructors & destructors
NET control
NET dataset objects
NET debugging tools
NET debug & trace classes
NET delegates & events
NET exception handling
NET globalization-localization
NET interoperability
NET project deployment
NET securing application
NET using XML
NET validating user input
NET windows communication
NET windows presentation
NET windows workflow
 
ASP.NET
C#.NET
VB.NET
AJAX
 
PHP
 
C
C++
Java
Data Structure
Oops
 
Database concepts
SQL Server
Oracle
MySQL
Data warehousing
Service-oriented architecture
SQL Server notification services
SQL Server Reporting Services
Sharepoint
Biztalk interview questions
 
Operating System
Project Management
Linux
Testing
Networking
Software engineering
 
UML
XML
HTML
SOAP
CSS
VBScript
 
CV tips
Cover letter tips
Interview tips
Human resources
Soft skills
Group discussion

.NET constants, enum, arrays & collection


.NET constants, enum, arrays and collection - Interview questions


.NET constants, enum, arrays and collection - October 30, 2008 at 18:10 pm by Amit Satpute

Describe how to create and use array in .NET.

Arrays treat several items as a single collection.

Following are the ways to create arrays:

Declaring a reference to an array
Int32[] a;

Create array of ten Int32elements
b = new Int32[10];

Creating a 2-dimensional array
Double[,] c = new Double[10, 20];

Creating a 3-dimensional array
String[,,] d = new String[5, 3, 10];

Define Constants and Enumerations in .NET.

Constants are values which are known at compile time and do not change.

Example:
Module Module1
         Sub Main()
                    Const abc = "100.00"
                    Console.WriteLine(abc)
         End Sub
End Module

An enumeration is a named constant. Enum provides methods to:

  • compare instances of classes,
  • convert the instance values to strings,
  • convert strings to an instance of a class,
  • create instance of a specified enumeration and value.

Explain collection in .NET and describe how to enumerate through the members of a collection.

There are various collection types in .NET which are used for manipulation of data. Collections are available in System.Collections namespace

IEnumerator is the base interface for all enumerators. Enumerators can only read the data from the data collections but not modify them. Reset and MoveNext are the methods used with enumerators which bring it back to the first position and move it to the next element position respectively. Current returns the current object.

Summarize the similarities and differences between arrays and collections.

The Array class is not part of the System.Collections namespaces Collections are. But an array is a collection, as it is based on the IList interface.

Array has a fixed capacity but the classes in the System.Collections namespaces don’t.

However, only the system and compilers can derive explicitly from the Array class. Users should use the array constructs provided by the language that they use.

Briefly describe the two kinds of multidimensional arrays in .NET.

There are two types of multidimensional arrays:

Rectangular arrays
These multidimensional arrays have all the sub-arrays with a particular dimension of the same length. You need use a single set of square brackets for rectangular arrays.

Jagged arrays
These multidimensional arrays have each sub-array as independent arrays of different lengths. With these you need to use a separate set of square brackets for each dimension of the array.



 
Today's Hot Jobs
C++  SQL Server
.NET  Java  Oracle
Finance  Marketing
Seekers  Employers
Copyright © 2008 CareerRide.com. All rights reserved.