HTML
Disclosure: This article may contain affiliate links. When you purchase, we may earn a commission.

How to use Context and useReducer for state management in React app? Example Tutorial

Introduction
A React component is made up of props and state. The state can be local or global. Usually, the local state is handled within the component using the setState method in class components and hooks in the functional components. But as the application grows, the state is usually required to be shared among multiple components. The global state is managed using third-party libraries such as Redux

Redux works perfectly but setting up redux is complicated and working with it is more complicated. So for moderate global state management, we can use Context API or the useReducer hook. But, there is one more way for managing the global state and that is by using the Context API and useReducer together.

What is "render props" in React.js? Example Tutorial

Props in React are properties that are passed from a parent component to a child component. Basically, props are plain JavaScript objects. Unlike the state, which is managed within the component, props are received as input from another component. As mentioned, props are JavaScript objects. But props are not limited to this only. There is another way of using props and it is known as “render props”. In this article, we will discuss what “render props” are and how to use this technique in React with the help of examples.

Top 20 Node.js Interview Questions with Answers for 1 to 2 Years Experienced Web Developers

Though Node.js is defined as a JavaScript environment, it is widely considered as a backend framework. Since its inception in 2008, Node.js has become a popular term in the server-side development community. More and more companies are using Node.js for backend development. There are several reasons for choosing Node.js. It is comparatively easier to use because JavaScript is used in Node. Moreover, it uses an event-driven and asynchronous model that enhances the performance.

How to send Emails in Java using Spring Framework? JavaMailSenderImpl Example Tutorial

Hello guys, if you are looking for a Java Spring tutorial to send emails then you have come to the right place. Earlier, I have shared the free spring framework online courses, and today, I am going to share how to send Emails in the Java application using Spring and JavaMailSenderImpl class which makes it really easy to send emails from Java application.  Email is an essential function of any enterprise Java application. Your application will need Email functionality to send reminders, bills, payments, confirmations, passwords, alerts, and several other kinds of system notifications.

Top 5 Courses to learn UML for Software Design and Development in 2022 - Best of Lot

Hello friends, we are here again today for another exciting topic to discuss. But, today we are not gonna discuss something which is related to Java or any other language or spring boot. Today we are gonna discuss something which is immensely practical and has the potential to land you very high paying jobs.

Today we are gonna take a look at the best available UML courses online.


So what's the wait? Let's start!

Top 6 Courses to Learn Neural Networks and Deep Learning in 2022 - Best of Lot

Hello guys, if you are looking for the best online courses to learn Deep Learning and Neural networks in 2022 then you have come to the right place.  In the past, I have shared the best Data Science courses, best Data Science websites, and best Machine Learning courses, and in this article, I am going to share the best online courses to learn Data Science and Machine Learning for Beginners. I have hoped a lot of online platforms and websites to find deep learning courses which not only cover essential concepts but also cover them in a way that can be easily understood, but most of the courses fall short of it. Some courses have great content they cover every possible concept but they are very hard to understand, and in some courses where you have engaging and easy to understood content then they shy away from covering advanced topics. 

Top 5 Courses to Learn MySQL Database in 2022 - Best of Lot

Hello guys, if you want to learn MySQL and SQL in 2022 and looking for the best resources like online courses, tutorials, and books then you have come to the right place. Earlier, I have shared the best SQL courses, books, and SQL interview questions and today, I am going to share the best online courses to learn MySQL in 2022. As you most probably know, MySQL is one of the big players in the Big Data technological ecosystem. It is one of the most popular databases in the world and has wide-ranging capabilities. It is used in a wide variety of industries, and so every half-decent programmer should at least have a basic understanding of MySQL.

My Favorite Blockchain Courses and Certifications for Beginners in 2022 - Best of Lot

Hello guys, If you're involved in the cryptocurrency space, then you've probably heard about Blockchain. Unless you're living under a rock . I'm talking about this new technology that offers what cryptocurrencies were most dangerous about… safety. With Blockchain, transaction safety is a must every time. Big companies invest big stacks of money in finding experts in this field. A blockchain expert's salary can go as high as $150,000 per year. So yeah, if you were thinking of learning about Blockchain, this is the right time to do so.

Top 20 Hibernate Interview Questions with Answers for Java Programmers

Hibernate is one of the most popular persistent frameworks in the Java world. Hibernate offers an object to relational (ORM) solution which frees Java developers from writing tedious, hard to read, and cluttered JDBC code converting SQL columns into Object properties. Apart from freeing Java developers from writing JDBC and database interaction code, Hibernate also offers the out-of-box solution on caching, proxying, and lazy loading which drastically improves the performance of your Java Web application. 

[Solved] Caused by: java.sql.SQLSyntaxErrorException: ORA-01722: invalid number in Java and Oracle

Hello guys, if you are getting below error in your Java program and wondering how to solve this or just stuck then you have come to the right place. In this article, I will explain to you what causes the " java.sql.SQLSyntaxErrorException: ORA-01722: invalid number" error when you connect to an Oracle database from a Java program and how you can solve it. 

But, first of all, let's take a look at the stack trace of this error which looks like below:

How to Parse JSON in Java Object using Jackson - Example Tutorial

Hello guys, if you are wondering how to parse JSON in Java then don't worry, there are many options. In the last article, I have shown you 3 ways to parse JSON in Java in this example, You will learn how to parse a  JSON String to Java and how to convert Java Object to JSON format using Jackson. JSON stands for JavaScript Object notation is a subset of JavaScript object syntax, which allows all JavaScript clients to process it without using any external library. Because of its compact size, compared to XML and platform independence nature makes JSON a favorite format for transferring data via HTTP. 

How to use useReducer in React.js and JavaScript? Example Tutorial

Introduction

Before the React hooks were introduced, it was not possible to use state in functional components. The React hooks transformed stateless functional components into stateful components in which state and lifecycle methods like functionality could be used. 


The useState hook is the primary hook for declaring the state in a functional component. Using it, a state variable can be declared and initialized along with a function to manipulate it. But sometimes state gets complex and the useState hook is not efficient to handle it.


So React provides another hook for complex state management in functional components. This hook is called useReducer. In this article, we will discuss what useReducer hook is and how to use it. 

Top 10 Android Interview Questions Answers for Java Programmers

Hello guys, if you are preparing for an Android app developer interview and looking for some Android interview questions then you have come to the right place. Earlier, I have shared free Android courses for beginners, and in this article, we will explore some of the most frequently asked Android interviews questions. Android is very hot nowadays as its one of the top operating systems for mobile and smartphones and a close rival to Apple's iOS. Android application developer job is in demand as well. I have also seen a couple of Java questions in an Android interview as well. It means it's better to prepare some Java questions as well. 

[Solved] java.lang.ClassNotFoundException: org.Springframework.Web.Context.ContextLoaderListener in Java and Spring

Problem : You are getting java.lang.ClassNotFoundException : org.Springframework.Web.
Context.ContextLoaderListener in your Spring-based Java Web application.
Cause: This error comes when you are using the Spring MVC framework in your Java Web application and configured org.springframework.web.context.ContextLoaderListener as a listener in your deployment descriptor also known as web.xml, but the JAR which contains this class is not available in the web application's CLASSPATH.

3 ways to Count words in Java String - Google Interview Questions with Solution

Today, I am going to share with you Java interview questions from Google, which were asked to one of my readers during the telephonic round. How do you count the number of words in a given String in Java? You can count words in Java String by using the split() method of String. A word is nothing but a non-space character in String, which is separated by one or multiple spaces. By using a regular expression to find spaces and split on them will give you an array of all words in a given String. This was the easy way to solve this problem as shown here, but if you have been asked to write a program to count a number of words in a given String in Java without using any of String utility methods like String.split() or StringTokenizer then it's a little bit challenging for a beginner programmer.

Difference between save(), saveOrUpdate() and persist() in Hibernate Session

The Session interface in Hibernate provides a couple of methods to move an object from a new or transient state to a persistent state like save(), saveOrUpdate(), and persist() is used to store an object into the database, but there are some significant differences between them. The Session.save() method does an INSERT to store the object into the database and it also returns the identifier generated by the database. On the other hand, saveOrUpdate() can be used to reattach a detached object in Hibernate Session i.e. it can do INSERT or UPDATE depending upon whether an object exists in the database or not. 

How to Remove all adjacent duplicates characters from String in java? Example Tutorial

Hello guys, if you are wondering how to remove adjacent repeated characters or duplicates from a given String in Java then you have come to the right place. In the last article, we have seen how to find duplicate characters as well as how to remove duplicate characters from String in Java, and in this article, we will take that topic to another level and remove adjacent duplicates from given String. This topic gives another perspective to removing duplicates in a word or phrase. Probably before now, you are familiar with removing duplicates from a word or phrase, or number. But this topic gives a detailed understanding of how to remove adjacent duplicates. 

How to test REST API from Command Line using cURL command in Linux? Example Tutorial

The curl or cURL command of Linux is a compelling and versatile command which allows you to send sophisticated HTTP requests right from your Linux command line window. You can use the cURL command to test your RESTful Web Services by sending GET and POST requests, doing authentication, saving a cookie in the file, etc. The curl command is, in fact, the go-to tool for many Java and Spring developers working in web applications and consuming data from the secured RESTful Web Services. Still, you can also use it to test your simple REST Web APIs without security. I have used it many times to check if our Web service is up or not, or is there any error while accessing those services.

11 JDBC Interview questions answers in Java - 2 to 4 years experienced programmer

Hello guys, if you are preparing for Java developer interviews then you may know that the JDBC Interview question forms one of the important sections in Java Interviews. Similar to multithreading, Collection framework, and Garbage collection interview question, JDBC questions must be prepared by any Java programmer. Most of the questions from JDBC or Java database connectivity come from API and basic architecture of JDBC which also involves JDBC drivers. A good understanding of JDBC API along with database basics like transactions also, help to do well in JDBC interviews.

7 Examples of HttpURLConnection in Java - Sending GET and POST Request [Tutorial]

If you want to learn how to send GET and POST requests from the Java program then you have come to the right place. Earlier, I have shared free Java Courses for beginners, and today, I am going to show you how to use HttpURLConnection class in Java to send HTTP requests to the server.  The HttpURLConnection is an important class in the java.net package which allows you to send an HTTP request from a Java program. By using this class you can send any kind of HTTP request like GET, POST, PUT, DELETE, HEAD, etc to the server and call REST APIs. 

Top 50 Core Java Basics Interview Questions with Hints and Answers

If you are preparing for your next Core Java interview and looking for some common questions to practice or check your knowledge, then you have come to the right place. In this article, I'll share 50 Core Java Interview Questions from various companies. I have already discussed the answers to these questions in this blog or Javarevisited, so I have just put the link. First, you should try to answer it yourself, and if you cannot then go to the link and find the answer. You can also compare your answer with mine and learn a few things here and there.

How to remove Duplicate(s) from linked list in Java? Example Tutorial

Hello guys, if you are wondering how to find duplicates in a given linked list in Java then you have come to the right place. In the past, I have explained how to reverse a linked list in Java, and in this article, I will show you how to find duplicate nodes in a given linked list. This is one of the classic linked list coding problem and I have also included this in my list of 30 common linked list problems for programmers. You can further check that list to practice more linked list programs and improve your understanding of linked lists and how to solve those problems. But, before we get into details of finding and printing duplicate nodes from the given linked list let's start with the basics. 

15 Technical Core Java Interview Questions Answers for Experienced Developers

When the experience of a Java Programmer grows in the years e.g. when it goes from beginner years ( 2 to 4) to more experience or sort of senior level ( 5 to 7 years), Core Java Interview Questions also change a bit. Of course, basics like data structure, algorithms, and object-oriented programming remains the same, but types of questions will become more advanced and their answers will definitely need to be more detailed and accurate. I often receive queries about core Java questions asked to a senior developer with 5 to 6-year experience, or, sometimes, I am going for an interview of a senior Java developer, what kind of questions I should expect. 

How to find Factorial in Java using Recursion and Iteration - Example Tutorial

Hello guys, if you are looking for a Java program to calculate factorial with and without recursion then you have come to the right place. Factorial is a common programming exercise that is great to learn to code and how to program. When I teach Java to new people, I often start with coding problems like prime numbers, Fibonacci series, and factorial because they help you to develop a coding sense and teach you how to write a program initially. In order to calculate factorial, you just need to know the factorial concepts from Mathematics, and rest I will explain this simple Java programming tutorial. 

Top 30 OOP Concept Interview Questions Answers in Java

Java is an object-oriented programming language and you will see a lot of object-oriented programming concept questions in Java interviews. The classic questions like the difference between an interface and abstract class are always there but from the last couple of years more sophisticated questions based upon advanced design principles and patterns are also asked to check the OOP knowledge of the candidate. Though, Object-oriented programming questions are more popular on Java interviews for 1 to 3 years experienced programmers. 

How to Perform Binary Tree InOrder traversal in Java using Recursion? Example Tutorial

The InOrder traversal is one of the three popular ways to traverse a binary tree data structure, the other two being the preOrder and postOrder. During the in-order traversal algorithm, the left subtree is explored first, followed by root, and finally nodes on the right subtree. You start traversal from root then go to the left node, then again go to the left node until you reach a leaf node. At that point in time, you print the value of the node or mark it visited and move to the right subtree. Continuing the same algorithm until all nodes of the binary tree are visited. The InOrder traversal is also known as the left-node-right or left-root-right traversal or LNR traversal algorithm.

Top 12 Servlet JSP Interview Questions for Java JEE Developers

Hello guys, Servlets and JSP Interview Questions are the core of any Java JEE Interview. It's expected from candidates to have good knowledge of Servlet, JSP, EJB, Struts, or Spring in any JEE interview. Consequently, Servlets and JSP Interview Questions are very common in any JEE Interviews along with some questions from core Java, Some interview Questions from Spring, and Some EJB interview questions. Since J2EE is the main platform for building enterprise and web applications using the Java programming language, it's important to prepare well for the Java web developer interview, especially If you are in the application development space. 

How to Find Duplicate Characters in String [Java Coding Problems]

Hello guys, today's programming exercise is to write a program to find repeated characters in a String. For example, if given input to your program is "Java", it should print all duplicates characters, i.e. characters appear more than once in String and their count like a = 2 because of character 'a' has appeared twice in String "Java". This is also a very popular coding question on the various level of Java interviews and written tests, where you need to write code. On the difficulty level, this question is at par with the prime numbers or Fibonacci series, which are also very popular on junior level Java programming interviews and it's expected from every programmer to know how to solve them.

Top 21 Frequently Asked Java Interview Questions with Answers

If you have been to a couple of Java interviews then you know that there are some questions that keep repeating like the difference between == and equals() method and many of its popular cousins like HashMap vs Hashtable, ArrayList vs LinkedList, the difference between equals() and hashCode(), or difference between Comparator and Comparable in Java. I call them frequently asked Java interview questions, and I suggest every Java developer make a list of them for their own reference and revision. I am sure many Java programmer already has such a list of questions handy if you don't have then this is a good time to find and make your own list, or if you are in rush then you can also buy my book Grokking the Java Interview, which contains many such questions. 

How to check if a node exists in a binary tree or not in Java? Example Tutorial

Hello guys, if you are wondering how to check if a given node exists in a given binary tree or not then you have come to the right place. I have been sharing a lot of binary tree-based programming interview questions in the past few articles. Earlier, we have solved how to find the maximum sum level in a given binary tree, how to find the lowest common ancestor, and how to find Kth smallest element, and in his article, we will solve another classical binary tree problem of search nodes.  Bug, before finding if a node exists in a binary tree or not. It is good to understand what is a  binary tree and binary search tree and how to solve a binary tree-based coding problem. 

How to Implement Binary Tree InOrder traversal in Java without Recursion - Example Tutorial

I have been writing about different binary tree traversal algorithms and so far we have seen both pre-order and post-order algorithms to traverse a binary tree and today you'll learn about the in-order or sorted order algorithms. This is actually the second part of implementing the inorder traversal of a binary tree in Java, in the first part, I have shown you how to solve this problem using recursion and in this part, we'll implement the inorder traversal algorithm without recursion. Now, some of you might argue, why use iteration if the recursive solution is so easy to implement? Well, that's true, but the iterative solution is often regarded better as they are not prone to StackOverFlowError. Another reason why we are discussing the iterative solution here is because of technical interviews.