Why java is free from garbage values??
Answers were Sorted based on User's Feedback
Answer / harsh singh
In java we have garbage collector , which is call by JVM in equal interval of time and remove garbage values or variables.
| Is This Answer Correct ? | 20 Yes | 4 No |
Answer / 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 |
Answer / mihirdash
Because in java all declare variables are known to programmer.other wise it create some logical error.let us take an example of c++/c language if declare 100 variable it is so difficult to remember which will i initialise and it will effect my output result .so,that there is no garbage values
in java.
| Is This Answer Correct ? | 10 Yes | 9 No |
Answer / mamitha
In Java, Based on OOPS concepts,By default garbage collection ll happens. The main disadvantage in C & C++ is garbage values. So, its removed in Java
| Is This Answer Correct ? | 1 Yes | 3 No |
How to perform selection sort in java?
What is a treemap in java?
Write a function for palindrome and factorial and explain?
0 Answers Honeywell, Huawei, Zomato,
What is string [] args?
What are locale settings?
Is alive and join method in java?
What is collection class in java? List down its methods and interfaces.
What is a bubble sort in java?
What is getkey () in java?
What is initial size of arraylist in java?
If I only change the return type, does the method become overloaded?
What is java console application?