Jump to content

Talk:Primitive wrapper class in Java

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 206.72.77.76 (talk) at 00:23, 31 March 2009 (Other languages). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Other languages

Is Java the only language using wrapper classes, or some sort of? -- Face 08:30, 31 October 2006 (UTC)[reply]

No, but it is the only language I know of that has primitive wrappers as part of the standard library/language. The distinction here is that the wrapper classes are to 'wrap' the non-object primitive types in an object so that every type can be treated generically as an object. —Doug Bell talkcontrib 09:59, 31 October 2006 (UTC)[reply]
Objective-C (Cocoa framework) has a NSValue class whose purpose is to wrap any non-object datatype, like C primitive types, C pointers, C structs, etc. into an Objective-C object. --206.72.77.76 (talk) 00:23, 31 March 2009 (UTC)[reply]

Non-primitive Wrappers

It's my understanding that wrapper classes need not refer specifically to the case of primitive wrappers, and for that matter they need not be specific to Java. I believe that in general wrappers can be used to add additional layers of encapsulation, but I came here hoping for a better definition only to find that Wrapper class redirected here. Shouldn't there be a separate page for wrapper classes in general, or at least something to indicate that not all wrappers are primitive wrappers? Mickeyg13 (talk) 22:59, 24 February 2009 (UTC)[reply]

Perhaps should Wrapper class redirect to a disambig page the points here as well as to the page for the Wrapper pattern? Presently it links directly here but "wrapper class" may reference the design pattern instead of the Java feature. Thoughts? Mickeyg13 (talk) 20:49, 25 March 2009 (UTC)[reply]