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                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  Dot Net  >>  Dot Net Framework
 
 


 

 
 Dot Net Framework interview questions  Dot Net Framework Interview Questions
 Dot Net Remoting interview questions  Dot Net Remoting Interview Questions
 Dot Net WindowsForms interview questions  Dot Net WindowsForms Interview Questions
 Dot Net General interview questions  Dot Net General Interview Questions
 Dot Net AllOther interview questions  Dot Net AllOther Interview Questions
Question
will this code works fine? or will it gives error?

Object obj=5;
int i=6;
i=i+obj;
 Question Submitted By :: Swapna
I also faced this Question!!     Rank Answer Posted By  
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 1
Defenitly it gives Error bcoz we cannot apply operators for 
the type object.
 
Is This Answer Correct ?    3 Yes 1 No
Sri4u_926
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 2
object obj=5 this is boxing

int i=6    this is initialization of variable.

i=i+obj;  here we can't sum the value type and reference 
type.


 so,it gives the error.
 
Is This Answer Correct ?    6 Yes 0 No
Naren
 
 
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 3
//can not applied this because i is value type and obj is 
reference type so this will create error
            //u can do this
            Object obj = 5;
            int i = 6;
            i = i + Convert.ToInt32(obj);
 
Is This Answer Correct ?    6 Yes 1 No
Amit Kumar Sharma
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 4
This code works fine
 
Is This Answer Correct ?    1 Yes 4 No
Sujata Bastia
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 5
YA it ll work fine
 
Is This Answer Correct ?    0 Yes 5 No
Usha
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 6
it will give an error...(we hv to typecast object to int)
 
Is This Answer Correct ?    1 Yes 0 No
Somnath Nanekar
 
  Re: will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;
Answer
# 7
this definitely work.
since obj as type integer. and also i as integer.
so the output will be 11.

its gives error when obj is type string.
 
Is This Answer Correct ?    1 Yes 0 No
Prakash Kesharwani
 

 
 
 
Other Dot Net Framework Interview Questions
 
  Question Asked @ Answers
 
I have interview in accenture.I cleared 1st round in techniqual.I have interview with project lead.pls help me. Accenture2
What is the common property in .net? Nth-Solution1
What are the ways to deploy an assembly?  1
I am confusing about reflection.can any one tell about REFLECTION with example? TCS1
what is .net? IBM12
What is a serverside technology? what is a clientside technology? what is a clientserver technology? what is a internet based application? what is a intranet based application? what is a windows application? what is a console application? Difference between console application and windows application? IBM3
Diffence between .net framework 1.0 and 2.0? DataPoint2
What is side by side Execution ? MMTS3
WHICH IS THE BEST INSTITUTE FOR DOTNET REAL TIME PROJECT TRAINING Cap-Gemini17
About DTS package ? Accenture1
WHICH IS MORE SECURED AMONG JAVA AND .NET?  7
What is CLR and how it generates native code ? Digital-GlobalSoft1
Can two application one using private assembly and other using Shared assembly be stated as a side-by-side executables?  1
How Garbage Collector identifies the objects which are not in use? Honeywell5
What is gacutil.exe. Where do we store assemblies ? Accenture2
Can u tell me differences which are introduced in .Net 1.1 and 2.0 and 3.0 and also in 3.5 ? by detailed? ABC1
What is "out" parameter how it is used in methods? Polaris6
Difference between <connectionstring> and <appsettings>  3
What is serialization in .NET? What are the ways to control serialization?  2
Can you draw and explain the .NET Farmework? Bosch2
 
For more Dot Net Framework 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