Jump to content
xisto Community
Sign in to follow this  
illusion

A Diff B/w C Sharp And Java "language"

Recommended Posts

well this is a new thing for me I read from somewhere..it is that the premiting data types in both the languages differ in nature. java's builtin Datatypes are not inherited from the base class Object where as C sharps integer and the like data types have object as there baseclass but not surprisingly C sharps premitive datatypes get a located in the Stack instead of heep means there are still the value types.what are u'r coments Does the C sharp Compiler totaly diferent features to work with these data types?

Share this post


Link to post
Share on other sites

The link between objects and primitive types is "boxing", a procedure that encapsulates a value type in an object when it is used where a object is required (such as passing a primitive type by reference). The whole boxing procedure is handled by the runtime and without needing the programmer to care about it.

You can find out much more about it by looking at:

 

http://forums.xisto.com/no_longer_exists/

Share this post


Link to post
Share on other sites

Hi!Both C# and Java treat primitives in the same manner by allocating primitive typed variables on the stack. The benefit the C# offers is the ability to call class functions without having to specify the complex type corresponding to primitive types while Java requires you to specifically indicate the class that you want to call the function of.Think of it along the lines of extension functions that C# provides - you can attach a function to any complex type or primitive type, yet the function itself would be located in a complex type.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.