Why java is free from garbage values??

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


Please Help Members By Posting Answers For Below Questions

What is identifier with example?

564


State the merge-sort principle and its time complexity.

567


What is a local block?

633


What are predicates in java 8?

527


How can you say java is object oriented?

587






What is java command?

562


what is use of functional interface in java 8?

553


What is the core java?

539


What are facelets templates?

587


How the interruptible method gets implemented?

554


What is the difference between and ?

503


What is static block?

584


Can an integer be a string?

510


What is a variable declaration?

515


What is the static keyword?

587