What is Garbage Collection

The runtime system keeps track of the memory that is allocated and is able to determine whether that memory is still useable. This work is usually done in background by a low-priority thread that is referred to as garbage collector. When the gc finds memory that is no longer accessible from any live thread it … Read more

How is An Argument Passed in Java, by Copy or by Reference What is a Modulo Operator

This operator gives the value which is related to the remainder of a divisione.g x=7%4 gives remainder 3 as an answer In Java, arguments are passed by value. This means that when you pass a primitive data type or an object reference as an argument to a method, a copy of the value is passed, … Read more

What is a Modulo Operator %

This operator gives the value which is related to the remainder of a divisione.g x=7%4 gives remainder 3 as an answer. In Java, the modulo operator % is used to find the remainder of the division operation between two numbers. It is often referred to as the “remainder operator.” The syntax is as follows: java … Read more

When Are Automatic Variable Initialized

Automatic variable have to be initialized explicitly. In Core Java, automatic variables, also known as local variables, are not automatically initialized. Automatic variables are variables declared within a method, constructor, or block of code. They don’t receive default values like class variables (instance or static variables) do. If you declare an automatic variable without explicitly … Read more

When Are Static And Non Static Variables of The Class Initialized

The static variables are initialized when the class is loaded Non static variables are initialized just before the constructor is called. In Java, static and non-static variables of a class are initialized at different times: Static Variables: Static variables, also known as class variables, are initialized when the class is loaded into the memory by … Read more