Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Sunday, July 30, 2023
How to Check if a Given Point Lies Inside a Triangle in Java? [solved]
Saturday, July 29, 2023
What is Constructor in Java and How it works? [with Example]
Tuesday, July 25, 2023
Difference between ReentrantLock vs synchronized lock in Java? Example Tutorial
Monday, July 24, 2023
Difference between an ordered and a sorted collection in Java? Example Tutorial
Hello guys, if you are working in Java collection framework then you may have heard about ordered as well as sorted collection classes. One of the related question to this concept is what is difference between ordered and sorted collection in Java, which is often asked to junior developers. In the past, I have shared 25 Java Collection interview questions as well as 130+ Java questions and in this article, I will answer this popular question. An ordered collection maintains the order of elements e.g. ArrayList maintains the insertion order of elements. Similarly LinkedHashMap can keep element in the order they are inserted or accessed.
Friday, July 21, 2023
3 Examples to Loop Map in Java - Foreach vs Iterator
5 Examples of Formatting Float or Double Numbers to String in Java
How to Synchronize an ArrayList in Java with Example
How to add Zeros at the Beginning of a Number in Java [Left Padding Examples]
3 Examples to Read FileInputStream as String in Java - JDK7, Guava and Apache Commons
Thursday, July 20, 2023
How to reverse ArrayList in Java with Example
How to Read, Write XLSX File in Java - Apache POI Example
Monday, July 17, 2023
How to declare a String in Java? Example Tutorial
Why is Abstract class Important in Java? [Example]
Friday, July 14, 2023
Difference between String literal and New String object in Java
Difference between Class and Object in Java? Answered
Thursday, July 13, 2023
How to Configure CORS in a Spring Boot + Spring Security application
Cross-Origin Resource Sharing (CORS) is an essential mechanism for controlling access to web resources across different domains. When developing a Spring Boot application with Spring Security, it is crucial to configure CORS properly to allow or restrict cross-origin requests based on security requirements. In this article, we will explore how to configure CORS in a Spring Boot + Spring Security application, ensuring secure and controlled access to resources. We will provide step-by-step instructions and relevant code examples to help you implement CORS effectively.