ALLInterview.com :: Home Page KalAajKal.com
 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                      
info       Did you received any Funny E-Mails from your Friends and like to share with rest of our friends? Yeah!! you can post that stuff   HERE
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
What is Boxing and Unboxing?
 Question Submitted By :: Poojitha
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is Boxing and Unboxing?
Answer
# 1
Boxing is to implicitly converting value type to refrence 
type,

int x = 10;
double y = x;


Unboxing is to explicitly converting refrence type to value 
type

double y = 10.234;
int x = (int)y;
 
Is This Answer Correct ?    2 Yes 0 No
Kautilya
 
  Re: What is Boxing and Unboxing?
Answer
# 2
The conversion of the value type to reference type is known 
as Boxing and converting reference type back to value type 
is known as Unboxing.
 
Is This Answer Correct ?    1 Yes 0 No
Lakshmi
 
 
 
  Re: What is Boxing and Unboxing?
Answer
# 3
Boxing is the process of converting value type to reference 
type.

Unboxing is the process of converting from a reference type 
to a value type.

Both are slow and should be avoided when possible or 
unneeded.

Dim st AS String
Dim obj As Object
Dim n As Integer = 5
st = n   ' Boxing happens
obj = n  ' Boxing happens

n = st   ' Unboxing happens
n = obj  ' Unboxing happens
 
Is This Answer Correct ?    0 Yes 0 No
Eduardo Belmonte
 
  Re: What is Boxing and Unboxing?
Answer
# 4
BOXING: Converting value type to referenc type.
        Here we go with an example,

ArrayList instance = new ArrayList() 
//In the above line of code,ArrayList is a reference 
type.Add some items to the arraylist. For example,

instance.Add(1);
instance.Add(100);
instance.Add(3);
//3 items added to the arraylist.
//Integer valuee 3 is value type.Adding 3 to the reference 
type(here it's arraylist) is boxing.
i.e., Converting value type to referenc type.

UNBOXING:Converting Reference type to value type.
         Below is an example, retrives the items from the 
arraylist.
         
foreach (int item in arrayList)
   Console.WriteLine(item);

Here arraylist(referenec type) will have 3 values in the 
list, which we added above. 
Adding this arraylist items to an int variable[here int 
variable is "item"] is unboxing.
i.e.,converting the reference type to value type.

Hope you would have understood.
Thanks
 
Is This Answer Correct ?    0 Yes 0 No
Kumaresh
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
Features of a dataset ? Accenture3
what is shared assembly? Microsoft2
What is the need of client side and server side validation ? Keane-India-Ltd1
About the Usage of htmlencode and urlencode ? Cognizent1
How to use one project files into another project? HP2
How can you change a Master page dynamically in which event of page life cycle? Fulcrum-Logic2
What is a bubbled event?  2
What is State Management in .Net and how many ways are there to maintain a state in .Net?  5
What is the best way to search any exact information on google? Intellevate2
What is the use of The Page.Master Property?  1
Usage of web.configuration ? Microsoft1
What does this do? sn -t foo.dll  1
can we transfer data from one page to another page using viewstate if so how?if not y? Wipro22
What is the difference between control and component?  1
Different type of validation controls in asp.net ? Keane-India-Ltd1
If we add a textbox and give the required field validator,and i add two radio buttons 1 is yes another one is No.And i add another one server control button ,if i click the button ,if the radio button Yes is checked the validation control is fired ,if no the validation control is not fired.So what you used to solve this problem. CTS6
How do we get only edited/deleted/inserted records from a Dataset? Syntax-Softtech1
which one is faster execute reader, scalar, execute non query ? Minecode13
We have 2 sites in which one site allows the user with out asking credentials and second one ask for credentials through a log page. What might be the configurations settings for both sites? We can use IIS and web.config files together. ADITI1
what is SQL cache Invalidation?  1
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com