Home » Java (page 30)

Java

PriorityBlockingQueue In Java

Introduction: A PriorityBlockingQueue in Java implements the BlockingQueue interface and supports the features of a PriorityQueue. So, what’s a BlockingQueue? Following holds true for any implementation of a BlockingQueue: While attempting to retrieve an element, a thread waits if the queue is emptyIn case of a bounded BlockingQueue implementation, the thread waits till it gets space to insert a new ...

Read More »

What To Expect From The New Version Of Selenium 4 Alpha?

All of us belonging to the testing domain are familiar with Selenium, one of the most popular open source automation tools available in the industry. We were pretty excited in August 2018 when Simon Stewart, Selenium’s founding member officially announced the release date of Selenium 4 and what new features it will bring to the users. The framework’s release got ...

Read More »

Lazy assignment in Java

Programmers are inherently lazy and similis simili gaudet also like when the programs are lazy. Have you ever heard lazy loading? Or lazy singleton? (I personally prefer the single malt version though.) If you are programming in Scala or Kotlin, which is also a JVM language you can even evaluate expressions in a lazy way. If you are programming in ...

Read More »

@Component vs @Repository vs @Service in Spring

spring-interview-questions-answers

Introduction: With Spring’s auto-scanning feature, it automatically detects various beans defined in our application. We usually annotate our beans using one of the available Spring annotations – @Component, @Repository, @Service, @Controller. On detecting the bean, Spring simply registers it into the ApplicationContext. In this quick tutorial, we’ll look at the difference between @Component, @Repository, and, @Service Spring annotations. @Component: We ...

Read More »

Spring Core Annotations

spring-interview-questions-answers

Introduction: Spring annotations present in the org.springframework.beans.factory.annotation and org.springframework.context.annotation packages are commonly known as Spring Core annotations. We can divide them into two broad categories: DI-Related Annotations & Context Configuration Annotations: In this tutorial, we’ll explore all of these Spring Core annotations. DI-Related Annotations: 1. @Autowired: We use @Autowired to mark the dependency which will be injected by the Spring container. ...

Read More »

LinkedHashMap In Java

Introduction: LinkedHashMap is a Map implementation which maintains the insertion order of its elements. It extends the HashMap class: public class LinkedHashMap<K,V> extends HashMap<K,V> implements Map<K,V> Just like a HashMap, it allows storing one null key and many null values. Instantiating LinkedHashMap: We can use one of the following constructors to create a LinkedHashMap: LinkedHashMap() //default capacity 16 with load factor ...

Read More »

Java Text Blocks

In the 13 May 2019 post “RFR: Multi-line String Literal (Preview) JEP [EG Draft]” on the OpenJDK amber-spec-experts mailing list, Jim Laskey announced a draft feature JEP named “Text Blocks (Preview)” (JDK-8222530). Laskey’s post opens with (I’ve added the links), “After some significant tweaks, reopening the JEP for review” and he is referring to the draft JEP that was started ...

Read More »

The beautiful simplicity of Apache Ranger plugin

If you are here, you already know what Apache Ranger is. It is the most popular, if not the only, way to manage security in the Hadoop framework. It has integrations with Active Directory, Kerberos and various others for authentication but I believe the most interesting feature is its authorization support. Being part of the Hadoop ecosystem, one would not be surprised ...

Read More »