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
How do you implement polymorphism in our day to day life?
What is the difference between math floor and math round?
What are constants and how to create constants in java?
What is OOP Language?
What is a marker interface?
What does n mean in java?
What is initial size of arraylist in java?
Why we cannot override static method?
Can you override static methods?
What is difference between null and void?
Can we store variables in local blocks?
How do you define a method?
What is difference between local variable and global variable?
Why is flag used in java?
Explain OOPs concept.