:: Home Page            
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Categories >> Software >> Microsoft Related >> C Sharp


 Visual Basic interview questions  Visual Basic Interview Questions (615)
 C Sharp interview questions  C Sharp Interview Questions (722)
 ASP.NET interview questions  ASP.NET Interview Questions (1444)
 VB.NET interview questions  VB.NET Interview Questions (150)
 COM+ interview questions  COM+ Interview Questions (41)
 ADO.NET interview questions  ADO.NET Interview Questions (199)
 IIS interview questions  IIS Interview Questions (86)
 MTS interview questions  MTS Interview Questions (5)
 Crystal Reports interview questions  Crystal Reports Interview Questions (62)
 BizTalk interview questions  BizTalk Interview Questions (33)
 Dot Net interview questions  Dot Net Interview Questions (861)
 Exchange Server interview questions  Exchange Server Interview Questions (103)
 SharePoint interview questions  SharePoint Interview Questions (25)
 WCF interview questions  WCF Interview Questions (8)
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions (193)
Can you store multiple data types in System.Array?
 Question Submitted By :: C-Sharp
I also faced this Question!!     Answer Posted By  
# 1
If you take an array of object, you can store multiple data
type in an array.
object[] obj = new object[4];
Is This Answer Correct ?    30 Yes 1 No
Neeraj Kumar Shrivastwa
# 2
No,we cannot store multiple datatype in Array.we can store
similar datatype in Array.
Is This Answer Correct ?    30 Yes 9 No
# 3
Is This Answer Correct ?    39 Yes 19 No
# 4
Yes you can, if you have an object array. since
System.Object is the base class of all other types, an item
in an array of Objects can have a reference to any other
type of object.
Is This Answer Correct ?    18 Yes 1 No
# 5
What payal has mentioned is absolutely right. Array doesnt
store different datatypes. but ArrayList can store
different types of datatype in a single object.
Is This Answer Correct ?    11 Yes 1 No
Vishal Shah
# 6
S, Use Generic lists. 
Is This Answer Correct ?    5 Yes 2 No
# 7
No,we cannot store multiple datatype in Array.we can store
similar datatype in Array,but i think that we can store in
ArrayList class in c#.
Is This Answer Correct ?    8 Yes 6 No
Payal Mehta
# 8
no..we cant ..only similar data types in an array.
but we can store in ArrayList
Is This Answer Correct ?    5 Yes 3 No
# 9
yes, if array type is specified as object 
Is This Answer Correct ?    2 Yes 0 No
# 10
Ok, so here is the catch:

An array of objects can store different datatype members -
object[] ar = new object[3];
ar[0] = "test";
ar[1] = 56;

An arraylist can also be used for this purpose -
ArrayList arr = new ArrayList();

And a generic list too can be used for this purpose -
List<object> llst1 = new List<object>();
Is This Answer Correct ?    2 Yes 1 No

Other C Sharp Interview Questions
  Question Asked @ Answers
What is indexers in C# Bodhtree 4
What’s difference between Association, Aggregation and Inheritance relationships? TCS 2
Is string reference type / value type ? Accenture 7
What is shared inheritance IGT 3
What?s the role of the DataReader class in ADO.NET connections?   2
What is the Use Of Interfaces? For example I have a interface as shown below? Interface IMyInterface { public void MyMethod(); } class MyClass : IMyInterface { public void Mymethod() { Some Code } } class Program { static void Main(string[] args) { MyClass obj = new MyClass(); obj.MyMethod(); } } Here What is My Question is? If i remove Interface and run this code, it will executed then what is the Use of the interface? Can any one give me the solution for this Problem? Thanks in Advance! HCL 1
in a town the percentage of total men is 52. the percentage of total literacy is 48. if total percentage of literate men is 35 of total population. write a program to find out the total no of illiterate men and women. HCL 3
What?s an abstract class?   4
Will finally block get executed if the exception had not occurred?   1
Is goto statement supported in C#? How about Java?   2
How structure objects are destroyed? As GC releases only the objects in stack, and structure is a value type and stored in heap. So how structure objects are released?   2
What is architecture of your poroject? how i c an say? Phoenix-Technologies 2
For more C Sharp Interview Questions Click Here 

Copyright Policy  |  Terms of Service  |  Articles  |  Site Map  |  RSS Site Map  |  Contact Us
Copyright © 2013  All Rights Reserved.   ::