How to send a request to garbage collector?

Answer Posted / anjum rehbar khan

Yes we can send arequest to garbage collection by writing a
simple line of code:

System.gc();

OR

Runtime.gc();

But it is simply a request not a order to JVM
because Garbage collection is JVM dependent

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the final class modifier?

551


Why is java logo a cup of coffee?

616


What is parsing in java?

525


Explain about join() method?

533


How can we make sure main() is the last thread to finish in java program?

660






When we serialize an object does the serialization mechanism saves its references too?

501


Can you start a thread twice in Java?

626


What is difference between identifier and variable?

464


How can you write a loop indefinitely in java programming?

543


What is the difference between java applets and applications?

560


What is the role of the java.rmi.naming class?

515


For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green  White will have 1 Weight.  Red and Green carry no weights.  Shortest path is the path with less weight when you add up the weights in the path.

1577


How we can generate random numbers in java?

599


What is difference between filereader and bufferedreader?

525


How to provide security in java

1798