Let’s learn garbage collection in java. Garbage collection in java Garbage collection means destroying or de-allocating unused objects in memory. Objects which are not used or has no references can be reclaimed. Garbage collector is used to reclaim unused memory automatically. Java handles memory de-allocation automatically since object once created uses some memory in the…

Read More Garbage collection in java

Let’s learn for loop in java. for loop in java for loop is used to iterate a block of statements multiple times. Use for loop if you know the number of iteration is fixed. Here are three types of loops in java with example, while loop do while loop for loop Loops in java executes…

Read More for loop in java

Let’s learn factorial program in java. Factorial program in java factorial of a number in java or factorial in java is one of the common java interview question. Factorial is the product of all integers less than or equal to given number. Denoted as n! For example, 6! = 6 * 5 * 4 *…

Read More Factorial program in java

Let’s learn how to delete a directory in java. How to delete a directory in java To delete a directory use delete() method of File class. delete() method deletes file or directory denoted by this abstract pathname. If this pathname denotes a directory, then the directory must be empty in order to be deleted. delete()…

Read More How to delete a directory in java

Let’s learn java convert decimal to octal. Java convert decimal to octal decimal to octal in java is one of the frequently asked interview question. In the below example we need to convert given decimal number (base value 10) into octal number (base value 8). To represent numeric value decimal number system uses 0-9 digits…

Read More Java convert decimal to octal

Let’s learn java convert decimal to hex. Java convert decimal to hex decimal to hexadecimal in java is one of the common java interview question. In number system, decimal number has a base of ten and has digits from 0 to 9. Whereas hexadecimal number has a base 16 and has digits from 0 to…

Read More Java convert decimal to hex