Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



What is wrapper class in java?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 30-01-2010
Member
 
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.

Reply With Quote
  #2  
Old 30-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,946
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.
Reply With Quote
  #3  
Old 30-01-2010
Member
 
Join Date: May 2008
Posts: 2,004
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.
Reply With Quote
  #4  
Old 30-01-2010
Member
 
Join Date: Apr 2008
Posts: 1,997
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());
    }
   }
}
Reply With Quote
  #5  
Old 30-01-2010
Member
 
Join Date: May 2008
Posts: 2,286
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.
Reply With Quote
  #6  
Old 30-01-2010
Member
 
Join Date: Oct 2005
Posts: 2,387
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.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 07:52 PM.