Learn Java and Programming through articles, code examples, and tutorials for developers of all levels.
Wednesday, September 29, 2021
QuickSort Algorithm Example in Java using Recursion - Tutorial
How to remove a number from an Integer Array in Java? [Example Tutorial]
Friday, September 24, 2021
3 ways to sort a List in Java 8 and 11 - Example Tutorial
There are multiple ways to sort a list in Java 8, for example, you can get a stream from the List and then use the sorted() method of Stream class to sort a list like ArrayList, LinkedList, or Vector and then convert back it to List. Alternatively, you can use the Collections.sort() method to sort the list. There is also a sort() method added to the List class itself. The Collections.sort() method is an older one and it's available from JDK 1.0 itself but List.sort() is a new method added in Java 8. This method accepts a Comparator if you want to sort a List in a custom order, otherwise, you can pass null if you want to sort a List on the natural order of their elements.
Thursday, September 23, 2021
5 Free SQL Books For Beginners and Experienced - Download PDF or Read Online
How Binary Search Algorithm Works? Java Example without Recursion
Wednesday, September 22, 2021
How to solve java.lang.NoClassDefFoundError: org/springframework/beans/factory/SmartInitializingSingleton in Spring Boot [Solved]
I was trying to run a HelloWorld program using Spring Boot when I got this error:
Exception in thread "main" java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer due to internal class not found. This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:52)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:92)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:174)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:136)
Tuesday, September 21, 2021
10 Examples to DateTimeFormatter in Java 8 to Parse, Format LocalDate and LocalTime
How to declare and Initialize two dimensional Array in Java with Example
How to use Spread operator and Rest parameter in JavaScript? Example Tutorial
Hello guys, if you are wondering what is Spread and Rest operator is in JavaScript are and how to use them in code then you have come to the right place. Earlier, I have shared some fundamental JavaScript concept tutorials like == vs === operator, hoisting, and destructuring, and in this JavaScirpt article, I am going to talk about Spread and Rest operators. JavaScript came out twenty-five years ago. Since then, it has changed a lot. First, it became the top programming language for client-side web development, and then with the emergence of Node.js, it also became the top player in server-side development.
Monday, September 20, 2021
What is Variable and Function Hoisting in JavaScript? Example Tutorial
Hoisting is a complex concept in JavaScript. Like other major programming languages, variables and functions are an important part of JavaScript. Being a dynamically typed programming language, the variable declaration does not require specifying variable types. JavaScript also supports functions. But there is a catch. When variables and functions are declared in JavaScript, a process called hoisting takes place, and if you don't know this important concept you may struggle reading and understanding code but don't worry. In this article, I will teach you what is hoisting in JavaScript and give you real-world examples of the function and variable hoisting to start with.
Sunday, September 19, 2021
What is Destructuring in JavaScript? Example Tutorial
Arrays and objects play a very important role in programming. Every major programming language supports arrays and objects. Both arrays and objects are used to store data. The concept is simple but very powerful. JavaScript also supports arrays and objects. In fact, they are a very important part of modern JavaScript development. It does not matter if you are working on the frontend or backend, you are going to use arrays and objects. Over time, more and more features were added in JavaScript to make it easy to work with arrays and objects.
Saturday, September 18, 2021
Difference between first level and second level cache in Hibernate
Difference between IN, OUT, and INOUT parameters in JDBC Stored Procedure? Answer
Hello guys, Java Database Connectivity, the JDBC API supports three types of parameters, I mean, IN, OUT, and INOUT. They are used to bind values into SQL statements. An IN parameter is the one whose value is unknown when the SQL statement is created and you bind values using various setXXX() method depending upon the type of column those IN parameter refers in SQL query. For example in SQL query, SELECT * from EMPLOYEE where EMP_ID=? if the EMP_ID is a VARCHAR column then you must call the setString() method to pass the value to the IN parameter.
Thursday, September 16, 2021
How to create a custom tag in JSP? Steps and Example
You can create a custom tag in JSP either by implementing the SimpleTag interface or extending SimpleTagSupport class. Custom tags are introduced in JSP 2.0 in an effort to minimize Java code from JSP to keep them maintainable and allow page authors to work more in HTML or XML, like environment than writing Java codes. SimpleTag and SimpleTagSupport allow you to create a custom tag in JSP. It's easier to start with SimpleTagSupport class because it implements all methods of the SimpleTagSupport interface and if you are writing a basic tag then you just need to override the doTag() method of this class.
Wednesday, September 15, 2021
How to use lifecycle methods in functional components in React.js? useEffect() hook Example Tutorial
Hello guys, if you have been following my blogs then you know that I have launched a new series - React for Java developers and this is the 4th article on the series. Earlier, we have seen state management in React, Redux, and useState hooks example, and in this article, you will learn about how to use lifecycle methods in functional React components. Lifecycle methods are powerful features provided by React.js in the class-based components. Each of the lifecycle methods executes at a particular time during the lifecycle of a component.
Tuesday, September 14, 2021
How to compare two Arrays in Java to check if they are equal - [String & Integer Array Example]
Monday, September 13, 2021
What is Redux Thunk in React.js? Example tutorial
Hello folks, This is the 3 part of my React for Java developer series and in the past two articles we have been focusing on statement management in React and we have seen that how to use manage state using Redux and useState hooks. And, in this article, we will learn about Redux Thunk, another useful concept when it comes to statement in React.js. State management is one of the most important concepts in react. If you are a react developer, then you must have used state in your project. There is no react project without a state. The state is defined as an instance of a component. It is an object that controls the behavior of a component.
How to Convert or Print Array to String in Java? Example Tutorial
How to Format Date to String in Java 8 [Example Tutorial]
Saturday, September 11, 2021
What is Redux and how to use it? Example Tutorial
Managing state efficiently is very important in a react application. A React application depends on its state. React provides in-built support to manage the state but as the application grows, this in-built support becomes inefficient. So to manage the state of a large and complex react application, we have to use third-party state management libraries. Redux is by far the most popular state management library. It is heavily used with react and if you are planning to work in a real-time react project, you will encounter redux.