Why java is free from garbage values??

Answers were Sorted based on User's Feedback



Why java is free from garbage values??..

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

Why java is free from garbage values??..

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

Why java is free from garbage values??..

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

Why java is free from garbage values??..

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

Post New Answer

More Core Java Interview Questions

Is 0 an even number?

1 Answers  


What is the use of System class?

1 Answers  


What is the public field modifier?

1 Answers  


Hai all I want to print given array in reverse order Ex: int a[]={1,2,3,4,5};display this array in reverse order.

4 Answers  


Which is better ascii or unicode?

1 Answers  


Is object a data type in java?

1 Answers  


What is a java object and java application?

1 Answers  


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

1 Answers  


After compilation of java program we'll get .class code. If it's generated in OS Windows XP will it work on OS Linux? If yes why? If no why?

5 Answers   Aricent,


what is the significance of listiterator in java?

1 Answers   IBS,


What is difference between identifier and variable?

1 Answers  


What is an empty class? What functionality does it offer in Java?

1 Answers   Deloitte, EXL, JPMorgan Chase,


Categories