Teja Kolloju has Published 13 Articles

Difference between Iterator and Enumeration in Java

Teja Kolloju

Teja Kolloju

Updated on 17-Apr-2025 19:00:12

7K+ Views

Iterator and Enumeration are both cursors to traverse and access elements from the collection. They both belong to the collection framework. Enumeration was added in JDK1.0 and Iterator in JDK 1.2 version in the collection framework.  Java Enumeration Enumeration: An enumeration is a special "class" that indicates a collection of ... Read More

Difference between Save and SaveAndFlush in Spring Java

Teja Kolloju

Teja Kolloju

Updated on 17-Apr-2025 18:59:54

5K+ Views

Save and SaveAndFlush both can be used for saving entities. They both are both belong to the Spring data library. Save may or may not write your changes to the DB straight away. When we call saveAndFlush system is enforcing the synchronization of your model state with the DB. What ... Read More

Difference between fail-fast and fail safe in Java

Teja Kolloju

Teja Kolloju

Updated on 17-Apr-2025 18:59:29

4K+ Views

In this article, we will find the differences between Fail-Fast and Fail-Safe Iterators. They both describe how collections behave when they are modified during iteration. What is an iterator? An Iterator is an object in Java used to cycle through a collection, accessing or removing elements. It can be ... Read More

Difference between volatile and transient in java

Teja Kolloju

Teja Kolloju

Updated on 17-Apr-2025 18:59:16

10K+ Views

In this article, we will find the differences between volatile and Transient. Both have a different purpose for specifying before a variable. These modifiers are important in determining the behavior and characteristics of variables in different cases. What is volatile? A volatile keyword is used in a multithreading environment ... Read More

Difference Between CrudRepository and JPARepository in Java

Teja Kolloju

Teja Kolloju

Updated on 17-Apr-2025 18:59:05

23K+ Views

CrudRepository and JPA repository both are the interface of the spring data repository library. Spring data repository reduces the boilerplate code by providing some predefined finders to access the data layer for various persistence layers. What is JPA repository? JPA is a repository interface that extends CrudRepository and PagingAndSorting repository. ... Read More

Difference between String buffer and String builder in Java

Teja Kolloju

Teja Kolloju

Updated on 15-Apr-2025 19:13:12

16K+ Views

String buffer and StringBuilder both are mutable classes which can be used to do operation on string objects such as reverse of string, concating string and etc. We can modify a string without creating a new object of the string. A string buffer is thread-safe whereas string builder is not ... Read More

Difference between Stack and Heap memory in Java

Teja Kolloju

Teja Kolloju

Updated on 15-Apr-2025 19:12:52

7K+ Views

JVM has divided memory space between two parts: one is Stack and another one is Heap space. Stack space is mainly used for storing order of method execution and local variables. Stacks always store blocks in LIFO order whereas heap memory uses dynamic allocation for allocating and deallocating memory blocks.  ... Read More

Difference Between ReentrantLock and Synchronized in Java

Teja Kolloju

Teja Kolloju

Updated on 15-Apr-2025 19:12:33

3K+ Views

There are two ways to get a lock on the shared resource by multiple threads. One is a Reentrant Lock (or read/write lock), and the other is by using the Synchronized method. The reentrant lock class has been provided in the Java concurrency package from Java 5.  It is the ... Read More

Difference between Thread and Runnable in Java

Teja Kolloju

Teja Kolloju

Updated on 15-Apr-2025 19:12:14

36K+ Views

There are two ways to create a new thread of execution. One is to declare a class to be a subclass of the Thread class. This subclass should override the run method of the Thread class. An instance of the subclass can then be allocated and started. The other way ... Read More

Difference between Serialization and Externalization in Java

Teja Kolloju

Teja Kolloju

Updated on 15-Apr-2025 19:11:58

3K+ Views

Serialization and externalization both are the processes of converting an object to stream byte and storing byte stream in database or memory. The class that implements java.io.Serializable interface can be serialized.  What is Serialization? Java provides a mechanism called object serialization where an object can be converted into a byte ... Read More

Advertisements