wrapper classes.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sujathaL
    New Member
    • Oct 2007
    • 4

    wrapper classes.

    hi,
    can u give me where exactly we use the wrapper classes.
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by sujathaL
    hi,
    can u give me where exactly we use the wrapper classes.
    What google says?

    Debasis Jana

    Comment

    • praveenkumarvpk
      New Member
      • Oct 2007
      • 22

      #3
      The wrapper classes also offer utility methods for converting to and from the int values they represent. Thus if you have a string that could also represent a number, you can use a wrapper class to perform that calculation.

      The methods of the wrapper classes are all static so you can use them without creating an instance of the matching wrapper class. Note that once a wrapper has a value assigned to it that value cannot be changed.

      http://www.jchq.net/certkey/0803certkey.htm

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        There's also an article in the Java Articles section (see the blue menu bar near
        the top of this page) about Wrappers/Decorators.

        kind regards,

        Jos

        Comment

        • sujathaL
          New Member
          • Oct 2007
          • 4

          #5
          Originally posted by JosAH
          There's also an article in the Java Articles section (see the blue menu bar near
          the top of this page) about Wrappers/Decorators.

          kind regards,

          Jos
          wer exactly is it??m not finding it.....

          Comment

          • JosAH
            Recognized Expert MVP
            • Mar 2007
            • 11453

            #6
            Originally posted by sujathaL
            wer exactly is it??m not finding it.....
            It's on the second page: there.

            kind regards,

            Jos

            Comment

            • heat84
              New Member
              • Nov 2007
              • 118

              #7
              An example of their use is when you want to add an integer to a vector.Vectors only contain objects so you have to convert the "wrap" the primitive type and conversion from wrapper to primitive is easy

              Comment

              Working...