Re: Is there a difference between the C# "int" and System.Int32 ???
From: David Browne (meat_at_hotmail.com)
Date: 08/25/04
- Previous message: sspy: "Unable to locate System.ComponentModel"
- In reply to: C Newby: "Re: Is there a difference between the C# "int" and System.Int32 ???"
- Next in thread: Morten Wennevik: "Re: Is there a difference between the C# "int" and System.Int32 ???"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 25 Aug 2004 15:10:52 -0500
"C Newby" <can@democracydata.com> wrote in message
news:%23AzthUtiEHA.1376@TK2MSFTNGP11.phx.gbl...
> That is as I thought.
>
> But I was wondering ... so far as I remember, there was an intrinsic
integer
> type in Java. Is there any reason to think that the .NET implementation of
> integers would suffer from performance problems (in comparison to Java),
> even if only slightly? Or is the Java implementation in fact the same and
> I'm just remembering it incorrectly?
>
> TIA//
>
Just to elaborate. . .
Java has a strict distinction between primitive types and non-primitive
types. You cannot create new primitive types, and you cannot cast a
primitive type to an object reference.
In .NET the type system containes both value types (which perform like
primitive types, are passed on the stack and have value semantics) and
reference types, which perform like Java Objects.
In doing this, .NET gets better performance for things like Decimal and
database-specific types which can be implemented as value types, and
eliminates the annoying manual boxing in Java where each primitive type has
an object wrapper type.
David
- Previous message: sspy: "Unable to locate System.ComponentModel"
- In reply to: C Newby: "Re: Is there a difference between the C# "int" and System.Int32 ???"
- Next in thread: Morten Wennevik: "Re: Is there a difference between the C# "int" and System.Int32 ???"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|