JAVA

Memory Leak in Java

Memory Leak The standard definition of a memory leak is a scenario that occurs when objects are no longer being used by the application, but the Garbage Collector is unable to remove them from working memory – because they’re still being referenced. As a result, the application consumes more and Read more…

By Ashish, ago
JAVA

Java Garbage Collection

Java Garbage Collection is the process to identify and remove the unused objects from the memory and free space to be allocated to objects created in the future processing. One of the best feature of java programming language is the automatic garbage collection, Garbage Collector is the program running in Read more…

By Ashish, ago
JAVA

Memory Management in Java – JVM Memory Model

Java (JVM) Memory Model At broad level, JVM Heap memory is physically divided into two parts – Young Generation and Old Generation. Young Generation Young generation is the place where all the new objects are created. When young generation is filled, garbage collection is performed. This garbage collection is called Read more…

By Ashish, ago
JAVA

Java is Pass by Value

One of the biggest confusion in Java programming language is whether java is Pass by Value or Pass by Reference. First of all we should understand what is meant by pass by value or pass by reference. Pass by Value: The method parameter values are copied to another variable and Read more…

By Ashish, ago
JAVA

Reverse a String is Java

There are many ways to reverse a String in Java. We will see traditional ways and using classes which provide in-build function. 1. Storing in reverse Order In above piece of code. We have assigned a char of length of String passed to it. In loop we are taking character Read more…

By Ashish, ago
JAVA

Difference between StringBuffer and StringBuilder

Based on my previous posts related to StringBuffer and StringBuilder let’s see the difference. StringBuffer StringBuilder StringBuffer was the only choice for String manipulation till Java 1.4 StringBuilder came into picture from Java 1.5. all of its public methods are synchronized all of its public methods are not synchronized StringBuffer provides Thread safety. StringBuilder Read more…

By Ashish, ago
JAVA

StringBuffer in Java

We will find answer for following questions What is StringBuffer Available Constructors Commonly used methods StringBuffer Java StringBuffer class is used to create mutable (modifiable) string. The StringBuffer class in java is same as String class except it is mutable i.e. it can be changed. The Java StringBuffer class is Read more…

By Ashish, ago
JAVA

StringBuilder in Java

We will find answer for following questions What is StringBuilder Available Constructors Commonly used methods StringBuilder Java StringBuilder class is used to create mutable (modifiable) string. The Java StringBuilder class is same as StringBuffer class except that it is non-synchronized. So its not thread safe and can’t be used if Objects Read more…

By Ashish, ago