can we add primitive data to wrapper class object

Ads

 
 

Share on Google+Share on Google+

Muneeb
can we add primitive data to wrapper class object
1 Answer(s)      6 years and 10 months ago
Posted in : Java Beginners

Hi, Here is my code: class Myclass{ public static void main(String args[]){ int i=2; Integer a= new Integer(3); a=a+i; System.out.println("a"+a); } }

Thanks

Ads
View Answers

November 10, 2010 at 3:10 PM


Hello Friend,

Yes, you can.

Thanks


Ads









Related Tutorials/Questions & Answers:
can we add primitive data to wrapper class object
can we add primitive data to wrapper class object  Hi, Here is my code: class Myclass{ public static void main(String args[]){ int i=2; Integer... Friend, Yes, you can. Thanks
Wrapper Class in Java
Wrapper Classes provide object methods for the eight primitive data types... package that defines the eight primitive data types in Java. We need Wrapper... that holds the value 10. Whereas, object of a Wrapper Integer class can be created
Advertisements
Wrapper Class
Wrapper Class  what is wrapper class in java and why we use it   Hi Friend, Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g.
Wrapper
provides wrapper classes corresponding to each primitive data types in its "... and corresponding wrapper class: Primitive type Wrapper class byte... utility methods to manipulate the values. All of the primitive wrapper classes
can we use scanner class,class , object and methods to get output without using constructor ????
can we use scanner class,class , object and methods to get output without using constructor ????  im getting error here..i hav used scanner class... am i getting error here... can we get output using scanner class , object
Wrapper Classes
. Wrapper class is a wrapper around a primitive data type. It represents... can be represented as a Boolean class instance. All of the primitive wrapper...Primitive Wrapper Class In this section you will learn about Wrapper classes
wrapper class.
wrapper class.  Write short note on character wrapper class.   Java Character Wrapper class The Character class wraps a value of the primitive type char in an object. An object of type Character contains a single field
Java Wrapper Class Example
respective wrapper class : Primitive Data Type Wrapper Class boolean...Java Wrapper Class Example In this section we will read about how to use the wrapper classes in Java. Wrapper classes wrap the primitive data types
wrapper class
wrapper class  list wrapper class methods
wrapper class
wrapper class  wrapper class methods
Primitive Data Types
In this section we will discuss about Primitive Data Types in Java 7
struts2 how can we add an radio button to form using a class(doa)
struts2 how can we add an radio button to form using a class(doa)  Hi I had created an class of subscription,and iam trying to add an radio... class: import java.util.*; /** * State generated by hbm2java */ public
struts2 how can we add an radio button to form using a class(doa)
struts2 how can we add an radio button to form using a class(doa)  Hi I had created an class of subscription,and iam trying to add an radio... class: import java.util.*; /** * State generated by hbm2java */ public
java-wrapper class
java-wrapper class  dear people, may i know how to convert primitive data type into corresponding object using wrapper class with example please!!!   public class IntToIntegerExample { public static void
Can you create an object of an abstract class?
Can you create an object of an abstract class?   Hi, Can you create an object of an abstract class? Thanks
wrapper class
wrapper class  why wrapper class does not have a default constructor
size of all primitive data
size of all primitive data   java program for to find the size of all primitive data types in java
Examples of Wrapper Class
Examples of Wrapper Class In this page we are giving you the links...;  1.  Adding value through add(int, Object) method. 2.  Adding value through add(Object) method. 3.  Append all elements through
Java Integer class
; Java provides wrapper classes corresponding to each primitive data types... wrapper object can be helpful in situations where only objects can be utilized... wraps a value of type int in an object. It's constructor can take int value
Are arrays primitive data types?
Are arrays primitive data types?   Hi, Are arrays primitive data types? thanks   Hi, In Java, Arrays are objects. Identifier are some... as primitive data type
Wrapper Classes
that manipulate data and allows to operate a certain work. Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented
Autoboxing in Java
types into Wrapper class by Java compiler takes place when: a primitive data... of corresponding wrapper class a primitive data type is assigned to a variable of the corresponding wrapper class. Primitive data type Wrapper class
wrapper classes
;Java Wrapper Class Wrapper class is a wrapper around a primitive data type. It represents primitive data types in their corresponding class instances e.g. a boolean data type can be represented as a Boolean class instance. All
Can we instantiate abstract class in Java?
Can we instantiate abstract class in Java?  HI, Can we instantiate abstract class in Java? Thanks   Hi, No, you can't instantiate an abstract class. Thanks
PHP Class Object
PHP Class Object: In object oriented programming a class can be an abstract data type, blue print or template. You could consider the name of a class as noun... the object $a, we  call the function disp with -> operator. Any class can
Wrapper Class - Java Beginners
Wrapper Class  What is Wrapper class? Why are they use
How can I initialize the JSONArray and JSON object with data?
How can I initialize the JSONArray and JSON object with data?  How can I initialize the JSONArray and JSONObject with data
How many cookie object we can store in a session? is there any limit?
How many cookie object we can store in a session? is there any limit?  How many cookie object we can store in a session? is there any limit
How can we save a data list in jsf?
How can we save a data list in jsf?  I have a code in jsf that fires a query in Data Base each time it is called, i have added a validation check to fire query only if list is not-empty but the list gets empty each time
Wrapper Class - Java Beginners
Wrapper Class  Please explain the above question on Wrapper class with some examples
can we use class in jsp which implements interface
can we use class in jsp which implements interface   can we use class in jsp which implements interface