Answer Posted / manikandan [ gtec,vellore ]
there are different type of data types such as int,char
etc.for example suppose if we using arrays it can store a
similar data types but we need to store a char and int in a
same array what can we do for this situation. the wrapper
class helps in this situation by storing a objects in to a
arrays.
example
ArrayList v=new ArrayList();
v.add(new Integer(1));
v.add(new Character('a'));//
the int and char are different type but we stores it by an
object.
Is This Answer Correct ? | 2 Yes | 2 No |
Post New Answer View All Answers
What is the use of flag?
What is hashmap and map?
What is a copy constructor in java?
What will happen if non-synchronized method calls a static synchronized method and what kind of lock it acquires?
Explain the features of interfaces in java?
What are the different types of methodologies?
Why super is first line in java?
what are abstract functions?
How do you escape json?
What are autoboxing and unboxing? When does it occur?
What is the finalize method do?
Can we compare two strings in java?
How do you empty a list in java?
v-model life cycle
How can you avoid serialization in child class if the base class is implementing the serializable interface?