473,657 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Does C# have Type Wrappers?

Hey folks,

Is it possible to create Type Wrappers in C#? If so, how do you do it?

For those not sure of what I mean, here's a quick link on Type Wrappers in
Java: http://home.cogeco.ca/~ve3ll/jatutor5.htm#tw

Thanks!
Nov 16 '05 #1
2 1316
John Smith <js@no.com> wrote:
Is it possible to create Type Wrappers in C#? If so, how do you do it?

For those not sure of what I mean, here's a quick link on Type Wrappers in
Java: http://home.cogeco.ca/~ve3ll/jatutor5.htm#tw


There's no need, due to boxing. However, your page has:

"Simple datatypes are passed by value and not by reference."

That suggests that you think reference type parameters in Java are
passed by reference - they're not, the reference is passed by value.
There's a difference between reference passed by value and value passed
by reference.

See http://www.pobox.com/~skeet/java/passing.html for more information.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2
Type wrapping is not needed in C# because the language will create an object
and place a value type into it when it is needed. This is called "boxing".
The inverse is to unwrap the value type from the object, which is called
"unboxing." The gyrations caused by Java's decision not to derive the base
types from the type "object" is simply not present in C#

Hope this helps,
--- Nick

"John Smith" <js@no.com> wrote in message
news:uQ******** *****@TK2MSFTNG P09.phx.gbl...
Hey folks,

Is it possible to create Type Wrappers in C#? If so, how do you do it?

For those not sure of what I mean, here's a quick link on Type Wrappers in
Java: http://home.cogeco.ca/~ve3ll/jatutor5.htm#tw

Thanks!

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2680
by: Peter Moscatt | last post by:
Does TKinter have a Grid widget ? If not (as I assume), what is the alternative ? Pete
28
1937
by: Peter Olcott | last post by:
I want to double check my understanding about how the .NET framework works. From what I understand every call to the .NET framework is ultimately translated into one of more API calls, is this correct?
14
4840
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it can be done using the designer but I intentionally don't want to use that. The one reason is that you cannot change the code generated by the designer. The other could be that you have more free hand and control to design your GUI. 2....
1
6877
by: TC | last post by:
Every time I open my project, I get a warning which says "There are updated custom wrappers available for the following referenced components: Office." When I double-click on the warning, I get a dialog box which says "One or more custom wrappers for COM components have been installed on your machine after you added references to those COM components. These wrappers may provide additional capabilities not offered by the auto-generated...
11
2539
by: Fan Yang | last post by:
I'm reading Modern C++ Design, and it is saying "Variable template parameters simply don't exist." But I find VC7.1 & VC8 support this feature.Who can tell me that which is right -_-b Many thanks.
20
3652
by: Bob Sanderson | last post by:
This is my code: if (file_exists($Fname)) { echo "<td>$Fname exists</td>"; } else { echo "<td>$Fname does not exist</td>"; } $Fname is the full path to the file I'm trying to verify. When I run the script, I get the following output:
1
1057
by: sn20063757 | last post by:
what is meant by the term type wrappers in java.What is their use in java programming
2
1558
by: sn20063757 | last post by:
what is meant by the term type wrappers .And what is their us in java programming . For example import java.util.*; import javax.swing.JOptionPane; public class Numyears { public static void main(Stringargs) { GregorianCalendar current=new GregorianCalendar(); int currentYear;
1
2289
by: seth | last post by:
Hi: I'm trying to read JSON strings sent from the browser. Here is the scenario: 1. Using YUI tookit 2. sending JSON string from YUI toolkit - using the provided asyncRequest method. **I would like to read the JSON string sent from the client on the
0
8402
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8608
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7341
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.