Home » #javabasics » Page 4

#javabasics

Garbage Collector

Garbage collection is an essential process in modern programming languages, including Java, to manage memory dynamically and automatically deallocate objects that are no longer needed. The Garbage Collector (GC) is a critical component of the Java Virtual Machine (JVM) responsible for reclaiming memory occupied by unused objects, thereby preventing memory leaks and optimizing memory usage. […]

Garbage Collector Read More »

Java Memory-Model

In this page, we delve into the intricate workings of Java Memory-Model . Whether you’re a beginner or an experienced Java developer, join us on this journey to unravel the complexities of Java Memory-Model. In the realm of programming, memory management refers to the dynamic allocation and deallocation of objects. In Java, this responsibility is

Java Memory-Model Read More »

Semaphore Class

A semaphore controls access to a shared resource through the use of a counter. What the counter is counting are permits that allow access to the shared resource. Thus, to access the resource, a thread must be granted a permit from the semaphore. Synchronized allows only one thread of execution to access the resource at the same time. Semaphore

Semaphore Class Read More »

Lock Interface

The lock interface is one of the most used interfaces in Java. Lock interface is available in the Java.util.concurrent.locks package which we use as a thread synchronization mechanism, i.e., similar to synchronized blocks. It is more flexible and provides more options in comparison to the synchronized block. It allows us to gain the benefit of fine-grained locking without having

Lock Interface Read More »

Fork/Join Framework

Java 7 introduced the fork/join framework. It is among the simplest and most effective design techniques for obtaining good parallel performance. Fork/join algorithms are parallel versions of familiar divide−and−conquer algorithms. The fork operation starts a new parallel fork/join subtask. The join operation causes the current task not to proceed until the forked subtask has completed.

Fork/Join Framework Read More »

Synchronization in Java

Synchronization is the coordination of two or more tasks to get the desired results. We have two kinds of synchronization: synchronization helps you avoid some errors you can have with concurrent tasks but it introduces some overhead. You have to calculate very carefully the number of tasks, which can be performed independently without intercommunication in

Synchronization in Java Read More »

MultiThreading

When we create an application, we write lines of code and logic is also correct. But still we wonder that our application is not upto the mark. One important factor that plays a vital role in any application development is its Performance.However the performance of an app is not only related to the number of

MultiThreading Read More »

Spring

41. Differentiate between WebClient and WebTestClient?The difference between the Web client and Webtestclient can be stated as follows. Web client Webtestclient Web client acts as a reactive client who performs non-blocking HTTP requests.  Webtestclient also acts as a reactive client that can be used in tests. It can handle reactive streams with backpressure. It can

Spring Read More »

Core Java

41. What is Static block in java?Static block in Java is mainly used to initialize the static data members. The specialty of the static block is that it is executed before the main method at the time of class loading.An example of the static block is as follows: 42. Can we execute a program without

Core Java Read More »

Core Java

31. What is operator precedence in java?Java provides a set of rules and regulations for particularly specifying the order in which operators are evaluated. If the expression has many numbers of operators then the operator precedence comes into action. This operator precedence evaluates the operators present in the expressions based on the priority. For example,

Core Java Read More »

Scroll to Top