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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
Is string a value type or a reference type?
 Question Submitted By :: .NetGuru
I also faced this Question!!     Rank Answer Posted By  
 
  Re: Is string a value type or a reference type?
Answer
# 1
Reference Type
 
Is This Answer Correct ?    3 Yes 0 No
Vidhya T
 
  Re: Is string a value type or a reference type?
Answer
# 2
String in .NET id 'Reference Type'.The reason is quite 
simple.All classes in the .NET Environment are 'Reference 
Type' & 'String' is a Class in .NET (not DataType as in VB 
6.0)
 
Is This Answer Correct ?    5 Yes 0 No
Tarun Kumar
 
 
 
  Re: Is string a value type or a reference type?
Answer
# 3
string is a value type...not reference type....we ll not 
create an (instance) for that one...
 
Is This Answer Correct ?    0 Yes 5 No
Raju
 
  Re: Is string a value type or a reference type?
Answer
# 4
String is Referenced Type and stored in the Heap....
 
Is This Answer Correct ?    4 Yes 0 No
Gulrez Alam
 
  Re: Is string a value type or a reference type?
Answer
# 5
run this code : to see that string is reference type


        SByte a = 0;
        Byte be = 0;
        Int16 c = 0;
        Int32 d = 0;
        Int64 ee = 0;
        String s = "";
        Exception ex = new Exception();

        object[] Types = { a, be, c, d, ee, s,ex };

        foreach (object obj in Types)
        {
            string type;
            if (obj.GetType().IsValueType)
                type = "Value Type";
            else
                type = "Reference Type";
            Response.Write(type);    
        }
 
Is This Answer Correct ?    3 Yes 0 No
Sheetal Shivdas
 
  Re: Is string a value type or a reference type?
Answer
# 6
string is a reference type.

string str = "hello";
char x = str[1];

here what we do is handling the memory.
which type allows you to handle the memory is reference types.
 
Is This Answer Correct ?    1 Yes 0 No
Senthilselvan
 
  Re: Is string a value type or a reference type?
Answer
# 7
String is a reference type. If two string variable has the 
same string it stored in the same heap memory address.

eg in VB.Net 
Dim a as string="Hello"
dim b as string="Hello"

both variable refer to same memory address. As strings are 
immutable reference type you can't get the change in one 
variable to another.
 
Is This Answer Correct ?    1 Yes 0 No
Albn
 
  Re: Is string a value type or a reference type?
Answer
# 8
string  is value type by nature. it does not follow rules 
of reference type. eg  

        string MyName1 = "chandrapal Singh";
        string MyName2;
        
        MyName2 = MyName1;
        MyName2 = "deepak";

Response.Write("MyName1 :" + MyName1 + " MyName2 :" + 
MyName2);

This gives Output
MyName1 :chandrapal Singh MyName2 :deepak

if this is reference type then the output should be 
MyName1 :deepak MyName2 :deepak
 
Is This Answer Correct ?    0 Yes 0 No
Chandrapal Singh
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
Usage of web.config? Microsoft1
how can you handle "control is not part of this page " error? FactorH3
Can we change the page layout in ASP.NET 2.0 as Grid Layout like in previous version TCS2
accessing a textbox that was created dynamically? for (int i = 0; i < t1; i++) { TextBox t2 = new TextBox(); t2.ID = "adf" + i; PlaceHolder1.Controls.Add(t2); } accessing data entered in the above created controls.  1
what is the difference between assemblyinfo and webconfig files?  1
Types of store procedure in Sqlserver?  2
How many types of sessions are there?  2
about view state and how validation controls will be executed on client and server Wipro1
How Web Services help Us? What r the difference between Remoting and webservices Protech4
What are the different types of Session state management options available with ASP.NET?  4
Write a code for "RequiredFieldValidator" in java script Wipro3
Could u send me the answer for this question as soon as possible. Im using 'System.net.mail.mailmessage' namespace for sending a mail from my application. What should I mention in 'system.net.mail.mailmessage.to' property and What should I mention in 'system.net.mail.mailmessage.from' property.  1
With example & diagram explain AutoPostBack.  1
what is new debug tools in asp.net ?  1
Explain how inline and code behind is used differently ?  1
i want to develope a page for online test using asp.net with c#.net. so, how to insert the questions in the database sqlserver2000 and how to pick the questions randomly when user login for test. plz send the code for this.... TCS2
Breifly explain about stack and heap memory Managemet?  1
How do you retrieve information from web.config ? MMTS4
what r the Templeats in ASP.net? Intel5
What is Response.Flush method ? Keane-India-Ltd2
 
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