use of wrapper classes?
Answers were Sorted based on User's Feedback
Collection accepts only object not primitive data-type And
server also works on only Objects.
So By help of wrapper class we can convert primitive
data-type to Object.
| Is This Answer Correct ? | 18 Yes | 0 No |
Answer / vino
wrappper class uses for primitive datatype act as object.
ex:int-Integer
| Is This Answer Correct ? | 0 Yes | 0 No |
Wrapper classes are used to wrap primitive types (eg: int,
double, etc) in Objects which can be placed into Vectors,
and many, many other uses.
Following table lists the primitive types and the
corresponding wrapper classes:
Primitive Wrapper
Boolean java.lang.Boolean
Byte java.lang.Byte
Char java.lang.Character
double java.lang.Double
Float java.lang.Float
Int java.lang.Integer
Long java.lang.Long
Short java.lang.Short
Void java.lang.Void
| Is This Answer Correct ? | 1 Yes | 3 No |
When you say String is immutable, what do you mean by that? Say I have String s = "Ness" s= s+"Technologies"; What will happen? If the value gets appended, then what is the meaning of immutable here?
1.IN CASE OF DYNAMIC METHOD DISPATCH WHY WE USE REFERENCE VARIABLE,WE CAN USE THE DIFFERENT DEFINED OBJECT DIRECTLY TO ACCESS THE DATA MEMBER AND MEMBER FUNCTION OF THAT RESPECTIVE CLASS?WHAT IS THE MAIN FUNCTION OF "REFERENCE VARIABLE" HERE?
Hi Friends, can you give difference between extending thread class and implementing runnable interface.
What is meant by stack and queue?
What is the importance of main method in Java?
Can we sort a map in java?
What is a method ?
Is it possible for yielded thread to get chance for its execution again ?
How to avoid the runtime exception ?
Why super is first line in java?
When can we say that threads are not lightweight process in java?
What language is an assembler written in?