Answer Posted / mihirdash
first take an example of c/c++,here the decaration and initialization is the programmer responsibility if not it gives the garbage value.but in java every thing is taken by jvm.we can declare any number of variable but it should be initialized.otherwise if we are going to use the uninitialized varibles the java compiler gives error.so there is no garbage value in java.
and if youu are created a object the keyword new is assigned default value during crreation of object
| Is This Answer Correct ? | 3 Yes | 0 No |
Post New Answer View All Answers
What is the difference between serializable and externalizable interface?
What is anti pattern in java?
What is the difference between assignment and initialization?
What is difference between hashset and hashmap in java?
What is the primitive type byte?
What are the principle concepts of oops?
What are identifiers in java?
Why is it called buffering?
What is the use of a conditional inclusion statement in Java ?
What is sizeof () operator?
Can you give few examples of final classes defined in java api?
How to create a base64 decoder in java8?
What is difference between == equals () and compareto () method?
How thread scheduler schedule the task?
Why do we use variables?