:: 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 (1443)
 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 ?    29 Yes 1 No
Neeraj Kumar Shrivastwa
# 2
Is This Answer Correct ?    39 Yes 18 No
# 3
No,we cannot store multiple datatype in Array.we can store
similar datatype in Array.
Is This Answer Correct ?    30 Yes 9 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 ?    17 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 ?    10 Yes 1 No
Vishal Shah
# 6
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 5 No
Payal Mehta
# 7
S, Use Generic lists. 
Is This Answer Correct ?    5 Yes 2 No
# 8
no..we cant ..only similar data types in an array.
but we can store in ArrayList
Is This Answer Correct ?    5 Yes 2 No
# 9
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
# 10
yes, if array type is specified as object 
Is This Answer Correct ?    1 Yes 0 No

Other C Sharp Interview Questions
  Question Asked @ Answers
how to communicate inventory system and account system?   1
When do you absolutely have to declare a class as abstract (as opposed to free-willed educated choice or decision based on UML diagram)? Mind-Tree 2
If i have 100 objects in my application are out of scope.when first time garbage collected how many objects memory reference are free? ITC-Infotech 2
To compute the monthly, half-yearly and annual sales made by all the salesmen of a company. Philips 1
why C++ Partial Object Oriented Programming Language and C# and Java Fully Object Oriented Language TCS 11
can we drive a class from delegate? InterGraph 4
Can u create multiple threads of execution ? IBM 1
What is the difference between directcast and ctype? Wipro 2
Can you allow class to be inherited, but prevent the method from being over-ridden? Mind-Tree 2
What are iterators? TCS 5
What is short circuit logical evaluation? TCS 1
what is collections and what is generics Bally-Technologies 4
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.   ::