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 rule of accessibility in java?
How many types of literals are there in JAVA?
What is a stringbuilder?
What are loops in java?
How do you compare arrays in java?
Can a class be a super class and a sub-class at the same time? Give example.
What lambda means?
What is the difference between length and length () in java?
How would you convert bytes to string?
Tell me are there implementations for sorting and searching in the java libarary?
What is jdbc api?
What is meant by 'Class access modifiers'?
what is synchronization and why is it important? : Java thread
Why is java multithreaded?
Is main a function?