Results 1 to 6 of 6

Thread: What is wrapper class in java?

  1. #1
    Join Date
    Dec 2009
    Posts
    32

    What is wrapper class in java?

    Hi Friends,

    I am new to the Java programming. I know java is Fully Object Oriented Programming language. And everything inside the java programming is based on the class. But the wrapper class is new for me. I am not able to find out the difference between the simple class and wrapper class. It will be great if you provides something regarding the wrapper class of java. I am waiting for your reply.

  2. #2
    Join Date
    Apr 2008
    Posts
    1,949

    Re: What is wrapper class in java?

    Hi,

    The Wrapper class of java represents the base class for a set of data sources. The java wrapper class doesn't comprises the constructors. All of the primitive wrapper classes in Java are immutable. Wrapper class offers library initialization services as well as the access for to the data source servers that the wrapper supports.Wrapper classes are used to represent primitive values when an Object is required. I hope now you have understood what is wrapper class.

  3. #3
    Join Date
    May 2008
    Posts
    2,015

    Re: What is wrapper class in java?

    Please refer following some method of the java wrapper class:
    • getVersion :It is used for retrieving the version of the wrapper.
    • getName :It is used for retrieving the name of the wrapper.
    • getCorelib : It is used for retrieving the library name of the wrapper.
    • getType : It is used for retrieving the wrapper type.

  4. #4
    Join Date
    Apr 2008
    Posts
    2,010

    Re: What is wrapper class in java?

    Hi friend,

    Please study following example of Wrapper class of class, it will definitely helpful for you to understand the concept of Wrapper class:
    Code:
    import java.util.*;
    
    public class WrapperDemo
    {
        public static void main(String args[])
    {
       
      Vector v1 = new Vector();
      v1.add(new Integer(1));
        v1.add(new Integer(2));
        for(int iu=0; iu < v1.size();iu ++){
            Integer iuw =(Integer) v1.get(iu);
            System.out.println(iuw.intValue());
        }
       }
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,302

    Re: What is wrapper class in java?

    In java the Wrapper class is nothing but the a wrapper class for to the Java API. The wrapper class in java also has special type known as "dynamic array wrapper class". This type of wrapper class is defined for each and every dynamic array which is declared as a parameter within the java program. There are two types of subclasses for to the Wrapper class i.e UnfencedWrapper class and another is FencedWrapper class.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,394

    Re: What is wrapper class in java?

    Hello friend,

    The Wrapper class divided into two sub category such as Atomic wrapper classes and Primitive wrapper class. The wrapper class of java is a class that encapsulates and wraps the functionality of the other component or class.The methods of the java wrapper classes are all static type so that it can be utilized without creating an instance of the matching java wrapper class. The Wrapper class integrated into the "java.util" package.

Similar Threads

  1. Converting java class to java bean class
    By Ucchal in forum Software Development
    Replies: 6
    Last Post: 09-08-2010, 10:24 AM
  2. TextComponent class of java
    By GurdeepS in forum Software Development
    Replies: 5
    Last Post: 06-03-2010, 06:39 PM
  3. How to write a wrapper around the JTextField class?
    By MAHAH in forum Software Development
    Replies: 4
    Last Post: 12-02-2010, 06:01 PM
  4. Don't know about Spring class of java
    By Sarfaraj Khan in forum Software Development
    Replies: 4
    Last Post: 11-02-2010, 09:29 AM
  5. Java Programming Language Basics: Reflection Basics and Class Class
    By mayuri_gunjan in forum Guides & Tutorials
    Replies: 6
    Last Post: 29-08-2005, 12:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •