I m giving this answer by reference to JAVA:
integer is basic datatype while string is not.
int is treated like single component.
While string is an object of a class name String
when u write
int a;
a refer to the memory location where int number is stored
while when u write
String a;
a is not string object. a fefer to an reference of string object which contain original data
in java a is of type I m giving this answer by reference to JAVA:
integer is basic datatype while string is not.
int is treated like single component.
While string is an object of a class name String
when u write
int a;
a refer to the memory location where int number is stored
while when u write
String a;
a is not string object. a fefer to an reference of string object which contain original data
in JAVA a will be of class type not String.a will point to object of type String
Check this exapmle updating a will also update b which is possible in reference type not in valutype.
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
myString a=new myString();
myString b = a;
a.Name = "Hello";
Console.Write(a.Name);
Console.Write(b.Name);
a.change();
Console.Write(a.Name);
Console.Write(b.Name);
}
}
public class myString
{
public String Name
{
get;
set;
}
public void change()
{
Name="World";
}
}
}