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 a= new Integer(3); a=a+i; System.out.println("a"+a); } }

Thanks

View Answers

November 10, 2010 at 3:10 PM

Hello Friend,

Yes, you can.

Thanks









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,ADS_TO_REPLACE_1 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... data type, it can only be achieved by using Wrapper Classes in Java
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: ADS_TO_REPLACE_1 Primitive type Wrapper... utility methods to manipulate the values. All of the primitive wrapper classes
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
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 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
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
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
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
Examples of Wrapper Class
Examples of Wrapper Class In this page we are giving you the links... in Java.   1.  Adding value through add(int, Object) method. 2.  Adding value through add(Object) method.ADS_TO_REPLACE_2 3. 
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
size of all primitive data
size of all primitive data   java program for to find the size of all primitive data types in java
Autoboxing in Java
an object of corresponding wrapper class a primitive data type is assigned to a variable of the corresponding wrapper class. Primitive data type... ((int, float, double) into their corresponding Wrapper class object (Integer
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
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
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
;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
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
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
Wrapper Class - Java Beginners
Wrapper Class  What is Wrapper class? Why are they use
object of object class
object of object class  what do u mean by "object of object class
Wrapper Class - Java Beginners
Wrapper Class  Please explain the above question on Wrapper class with some examples
class and Object
class and Object  how many classes,References and objects... In the statement: A a=new B(); There are 2 classes, Class A and Class B. References : 1 (Object of B is referenced by A) Variable: a ThanksADS_TO_REPLACE_2
Class and object
Class and object  what is exact meaning for the statement, A a1=new B();   Hi, Here is two classes A and B. A is super class and B is sub class. Here is the code example:ADS_TO_REPLACE_1 public class
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
wrapper class concept
wrapper class concept  Write a Java class that stores an integer item id, a string item name and a float price. Store all these in a String member Variable, separated by a space delimiter. Use an overloaded method to add
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
Can we learn Data Science in 3 months?
Can we learn Data Science in 3 months?  Hi, I am beginner in Data...: Can we learn Data Science in 3 months? Try to provide me good examples or tutorials links so that I can learn the topic "Can we learn Data Science in 3
Can we do data science after 12th?
Can we do data science after 12th?  Hi, I am beginner in Data... we do data science after 12th? Try to provide me good examples or tutorials links so that I can learn the topic "Can we do data science after 12th?"
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
Wrapper Class Tutorial and Examples
Wrapper Class Tutorial and Examples   ... an element with the add(int, Object) method In this section you will learn to insert an element at the specified position using the add(int, Object) method
Wrapper Character class.
Wrapper Character class.  How do the methods 'isIndentifierIgnorable(ch)' and 'isISOControl(ch)' work?? while workin with 'Character' wrapper class... otherwise or you can say it determines if the specified character should
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
Primitive Data Types
Primitive Data Types In java, all the variables needs to be declared first.... The value assigned to a variable determines its data type, on which the legal... below : Java Data Types
Character Wrapper Class.
Character Wrapper Class.  what are Mirrored Unicode Characters?? and whats the use of "isMirrored(ch);method ??.where ch is any character argument..!!   Unicode is capable of representing many languages, including those
Convert Object to Int
Object into a primitive type int and Integer Object to primitive type int. . ... type object into primitive type int and Integer type object to primitive type int. The parseInt() method of an Integer class takes a numeric string object
Object class in java
Object class in java  want an example and with an explaination about equals() method in object class? Is equals() is similar
Class, Object and Methods
Class, Object and Methods       Class : Whatever we can see in this world all the things are a object... properties of the class or its group. We can understand about the class and object
java object class methods
java object class methods  What are the methods in Object class?  There are lots of methods in object class. the list of some methods are as- clone equals wait finalize getClass hashCode notify notifyAll
Does memory for Class or Object?
Does memory for Class or Object?   Does memory for class(methods & instance variables)allocated without it's object creation?If no,then The main() itself has associated with a class for which there is no instance creation,how
Object Class Methods in Java
We are going to discus about Object Class Methods in Java...(), wait(), etc Java object class methods are:- finalize() clone() equals... system call its finalize() method. Object's class finalize method
write a program to demonstrate wrapper class and its methods......
write a program to demonstrate wrapper class and its methods......  write a program to demonstrate wrapper class and its methods
Limit the Class Object Creation
Limit the Class Object Creation In this section you will learn about how a class object creation can be a restricted to a fix number of times... to restrict the object creation of a class. This is a simple code in Java where I have
ModuleNotFoundError: No module named 'kw-automation-data-wrapper'
. You can install kw-automation-data-wrapper python with following command...ModuleNotFoundError: No module named 'kw-automation-data-wrapper'  Hi...: No module named 'kw-automation-data-wrapper' How to remove

Ads