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

How to send Email in Java + 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.

How to set the logging level in Spring Boot application.properties - Example Tutorial

Hello guys, if you are wondering how to set the logging level on spring boot then you have come to the right place. In the past, I have shared the best Spring Boot courses and free courses to learn Spring MVC and in this article, I will share how to set logging levels like DEBUG and INFO in Spring Boot.  How do we configure the logging level of our Spring boot application is one of the questions that arise when developing a large application. Because we need to trace errors, warnings, informational data when running our application and to this, Spring has introduced Spring boot logging configurations. 

Top 20 UI and UX Design Interview Questions and Answers

Hello folks, if you are a fresher who want to start your career in UI and UX design or a UI or UX Designer and preparing for your next job and looking for popular UI/UX  interview questions for preparation then you have come to the right place. Earlier, I have shared HTML Interview Question, CSS Interview Questions, web development questions, and JavaScript Interview Questions and in this article, I am going to share common UI and UX interview questions with answers. If you have worked in UI and UX design for quite sometime then you may know the answers of these questions but if you are new then you may need to go through these best UI and UX design courses to refresh you knowledge about essential UI and UX design concepts. 

Spring Boot + Thymyleaf Project in Java? Example Tutorial

Hello guys, if you are looking for a Spring Boot and Thymyleaf example, tutorial, or a project then you have come to the right place. Thymyleaf is one of the most popular, modern, server-side Java template engine to generate HTML and XHTML content. Earlier, I have shared Spring Boot + Reactjs project, as well a complete project to create Spring Boot + REST and Spring Boot + Microservices and in this tutorial, you will learn about how to create a spring boot and thyme leaf application using the h2 database.  So before moving to an example, let's discuss what is thymyleaf? Thymeleaf is a web application development library based on Java. It offers excellent support for providing XHTML/HTML5 in web applications.

How to use @ResponseBody and @RequestBody in Spring MVC and REST? Example Tutorial

Hello guys, if you are wondering what is @RequestBody and @ResponseBody annotation in Spring MVC and Spring Boot then you have come to the right place. Earlier, I have told you about the @RestController annotation and in this article, I am going to explain to you what is RequestBody and ResponseBody annotation, how to use them, and when to use them with simple examples. While working with REST API, we may need to bind HTTP requests and response bodies with the domain object. To bind this, we use we can use the @ResponseBody and @RequestBody annotations in Spring MVC. 

Top 20 YAML Interview Questions Answer for Developers and DevOps

Hello guys, if you don't know YAML stands for Yet Another Markup Language and its one of the popular language for defining system rules. YAML is used in Spring Integration and most popularly in Ansible for defining Ansible playbook which you can use to install or uninstall application and do other stuff. Because of that reasons YAML has become quite popular and you may be asked about basic questions in YAML if you are going for a Developer or DevOps Interview where YAML skills are required. At the very minimum you should know how to read YAML and how to write YAML, particular declaring list and key-value pair in YAML. It's not a big topic but knowing basic really help during interview.

How to test a Spring Boot application in Java? @SpringBootTest Example

Hello guys, if you are wondering how to test your Java + Spring Boot application then you are at the right place. Earlier, I have shared best Spring Boot Courses and Spring Boot + Microservice example and in this article, I will talk about how to test your Spring boot application, mainly about writing unit test and integration test for Java and Spring boot application. Unit testing and Integration testing are two skills which separates a normal developer from a professional Java developer and when it comes to testing Spring applications many Java developer doesn't really know how to do that. If you are new to Java and Spring development but keen to learn Unit testing both Java and Spring Boot application then you have come to the right place.

Java + Spring Boot + Microservices Example - Step by Step Guide

Hello guys, if you are wondering how to create a Microservice in Java and Spring Boot then you are ar the right place. In the past, I have shared best Spring Boot courses for Microservices, Interview Questions as well as essential Microservice design principles and patterns like circuit breaker, CQRS, Event sourcing etc and In this article, we will cover the fundamentals of microservices with Spring Boot utilizing Spring cloud. We will cover a few fundamental ideas and then we will make a little micro-service to give you an outline. I will also share step by step guide to make Microservices in Java and then deploy them using Docker and Kubernetes on Cloud. 

How to Find Lowest Common Ancestor of a Binary Tree in Java? Example Tutorial

Hello guys, if you are wondering how to find the lowest common ancestor of a binary tree in Java then you are at the right place. Earlier, I have shared 40+ binary tree questions and today I am going to share solution of one of the popular binary tree question here. To find the lowest common ancestor of a binary tree in java requires that we run through a binary search tree and how it operates.  What then is a binary search tree? A Binary tree is a data structure in which each node can have at most two children. That is, each node in the binary tree will have data, left child and right child. The first node of the tree is called the Root.

How to Enable Disable Spring Security in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to enable and disable Spring Security in a Spring Boot based Java application then you have come to the right place. In the past, I have shared best Spring security courses25 Spring Security questions, as well multiple Spring security tutorials like how to use HTTP Basic auth in Spring Security etc.  and in this article, I will share multiple ways to enable and disable Spring Security in a Spring boot application. But, before that, if you are new to Spring Security then find out what is Spring Security and how does it work?  At its core, Spring Security is simply a bunch of servlet filters that assist you with adding authentication and authorization to your web application. 

Difference between Binary Tree, Binary Search Tree (BST), and Balanced Tree (AVL and Red Black Tree)?

Hello guys, if you are preparing for technical interview for Software Development job then you must prepare well for Data Structure and Algorithms. It is often the difference between selection and non-selection and when it comes to Data Structure, binary search tree is one of the tough topic to master. In the past, I have shared 100+ data structure questions and 40+ binary tree questions and today, I am going to share one of the popular theory or concept questions related to binary tree data structure.  The Tree data structure is one of the essential data structures, but unfortunately, many programmers don't pay enough attention to learning Trees, particularly advanced tree data structures like balanced trees like AVL and Red-Black tree. 

How to set base URL for REST in Spring Boot? Example Tutorial

Hello guys, if you are wondering how to set base URL for REST API in Spring Boot then you have come to the right place. Earlier, I have shared best REST API Courses for Java developers, REST API Books,  and a complete guide to create RESTful Web service using Spring Boot, in this article, I will show you how to set a base URL in any spring boot application? If you don't know what is a base URL in a REST application or website, let me give you a brief overview first.  A base URL is the continuous element of your REST API or website's address. For example, you'll notice that the address portion http://twitter.com displays in the address bar whenever you log on to your Twitter account or visit a Twitter profile from your computer. This is the primary or base URL.

How to Find/Print Leaf nodes in a Binary Tree in Java without Recursion - Example

In the last article, you have learned how to print all leaf nodes of a binary tree in Java by using Recursion, a useful technique to solve binary tree problems and in this article, we'll answer the same question without using Recursion. Why should we do this? Well, it's a typical pattern on a programming job interview to solve the same problem using both Recursion and Iteration. Since some questions are easy to solve using recursion like linked list problems, binary tree-based problems, tower of Hanoi, or Fibonacci series but their non-recursive solution is comparatively tricky, the interviewer tests candidates against this shift in the algorithm.

Top 50 Core Java Interview Questions and Answers for Beginners

Hello guys, 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 and given hint or mentioned the key point you need to know to answer these questions. 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.

Top 20 Linux and SQL Interview Questions for Java and IT Professionals

Hello guys, If you have worked as a software developer or Java programmer then you know that SQL, Linux, and Networking fundamentals are essential skills for any Java developer, especially for server-side Java programmers. It actually doesn't matter whether you are applying for the job as a Java developer or C++ developer, Python developer or Ruby programmer, SQL and UNIX always have some role to play in your career. It's even essential for people who have less to do with programming like application support guys, business analysts, project managers, and subject matter experts.  Hence, it's imperative for any programmer or IT professional to prepare both SQL and UNIX well before going for any job interview.

Top 20 Ansible Interview Questions Answers for DevOps and Senior Developers

Hello guys, if you are preparing for DevOps or senior developer interview then you must pay attention to modern Software development and deployment tools like Docker, Kubernetes, Ansible, Chef and Salt, Puppet etc. Gone are the days where you can crack any Java Developer interview by just answer few core Java questions about HashMap and ConcurrentHashMap, nowadays a lot is expected from Java developers. There are coding round where you need to solve coding problems and then there are multiple rounds of phone and video interviews where you are asked all of kind questions about Java, Spring Boot, as well as essential tools like JUnit, Mockito, Docker, Kubernetes, Ansible etc. While focus could be different, depending upon your role, like for DevOps knowledge of Ansible is very much required for Developer only basic knowledge is good enough. 

21 Frequently Asked Java Interview Questions Answers for 2 to 3 Years Experienced Programmers

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. 

Top 53 Java Programs from Coding and Programming Interviews

Hello guys, if you are learning to code and programming, or preparing for a programming job interview and looking for some practice material then you have come to the right place. Earlier, I have shared the best string, array, linked list, and binary tree coding problems and In this article, I am going to share some of the most common Java coding and programming problems for beginners. These are the problems, I have solved myself to learn to program and develop a coding sense and these are the ones that keep coming on Java coding interviews. By going through these coding problems you will not only learn Java but also prepare yourself for Java interviews. 

Top 50 Database and SQL Interview Questions Answers 1 to 5 Years Experienced

Hello guys, whether you are preparing for Java developer interview or any other Software Developer Interview, a DevOps Interview or a IT support interview, you should prepare for SQL and Database related questions. Along with Data Structure, Algorithms, System Design, and Computer Fundamentals, SQL and Database are two of the essential topic for programming or technical Job interview. In the past, I have shared many questions related to MSSQL questions, Oracle Questions, MySQL questions, and PostgreSQL questions and in this article, I am going to share both theory based and query based Database and SQL Interview questions with to the points answers.

Top 21 Git Interview Questions and Answers for Programmers and DevOps

Hello guys, if you are preparing for Software developer interview then you should prepare for Git, one of the essential and most popular version control and source control tool in Software industry. Almost every company, both big and small are now using Git to store their source code and conduct code reviews, yes the code review is one of the main reason many organization shifted to Git. Both Github and BitBucket provides in-built code review features which also promote good software development practices. 

Top 20 Agile and Scrum Interview Questions with Answers for 2 to 4 Years Experienced

Hello guys, ,if you are preparing for Software Developer interview then it makes to prepare questions on Agile and Scrum methodology. Agile is the standard way to develop software and most of the companies, both big and small follows Agile to develop and deliver Software. Before we get to the all-important interview questions that will help you land your dream software job, let me tell you something about Agile and Scrum. Agile Scrum is actually one of the best technologies out there today that will help you to implement accurate projects. Almost all of the major companies in the world use Agile these days. What that means for job hunters like you is that once you master this exciting technology, you will be able to position yourself really well in today's market.

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 and why not they are the back bone of Java Web technology. While the industry have moved from JSP and JSF to React based frontend there are still millions of applications which are using JSP and Servlet in backend. They are also the underlying technology for any web framework on Java like Spring MVC or Spring Boot and It's expected from candidates to have good knowledge of Servlet, JSP, EJB, Struts, or Spring in any JEE interview. That's why 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

Top 20 Java Web Service Interview Questions with Answers

Java Web Services Questions and Answers
Web Services interview questions are part of J2EE interviews for jobs which are looking for some experience in Java web services Space. Most of the Web services questions come from two different ways of implementing Web Services like SOAP and REST. SOAP is standard and mature way of calling Web Services which uses XML while REST is a new way of implementing Web Services which is based on HTTP protocol. In fact REST Web Service interview questions are getting more and more popular on the web services interviews in Java, So if you are going for any Java J2EE interview which require some web service experience, be prepared with both SOAP and REST Web services questions.

Top 20 Jenkins Interview Questions Answers for Beginners and Experienced Developers

Hello guys, if you are preparing for Java developer interview or DevOps Interview, one tool which you should know well is Jenkins, the king of Continuous Integration and Continuous build, one of the most desirable skill companies look on experienced programmers now a days. Earlier, I have shared best free Jenkins courses for programmers to learn this useful tool as well as Interview questions on DevOps, Docker, and Kubernetes and in this article, I am going to share 20 frequently sked Jenkins and CI/CD Interview questions with answers for both beginners and experienced developers. 

Top 20 Selenium Interview Questions with Answers for Programmers and Testers

Hello guys, if you are preparing for Selenium Developer or Automation Testing Engineer interview and looking for frequently asked Selenium Interview Questions then you have come to the right place. Earlier, I have shared 130+ Core Java Interview Questions and 20 JUnit Interview Questions and in this article, I am going to share 20 common Selenium questions from interviews with answers. If you have worked with Selenium or used Selenium in your project then most likely you can answer all of these questions but if you struggle to answer any of these Selenium interview questions then you have always go back and check one of these best Selenium online course to learn and revise key Selenium concepts. 

Top 20 Python Programming Interview Questions with Answers for 1 to 2 Years Experienced

Hello guys, if you are preparing for Python developer interview and looking for common and frequently asked Python Interview Question then you have come to the right place. Earlier, I have shared best Python courses, books, and projects and today, I am going to share best Python Interview questions with answer to get you the Python developer job you always wanted. Understanding python is easy if you choose to. What is needed is more and more practice. In this article you will find the questions that are frequently asked during python interviews. You have to take your time and go through the questions with answers and you will be more than prepared as far as python interview is concerned. 

Top 27 Spring Security Interview Questions with Answers for 3 to 5 Years Experienced Java Developers

Hello guys, if you are preparing for Java and Spring Developer interview then you should prepare about Spring Security. Since Security is an important topic and Spring security is the most popular framework to implement security in Java web applications, there is always a few questions based upon Spring Security in Java developer interviews. In the past, I have shared Spring Boot questionsSpring Data JPA Question, Spring Cloud Questions, and Microservices Interview Questions and in this article, I will share 20 popular Spring security questions for practice. I have also shared answers so that you can revise key Spring security concepts quickly but if you think that you need more preparation on certain topic then you can also checkout this list of best Spring Security courses where I have shared online courses to learn Spring security in depth. 

Top 10 tools for SQL Developers and Database Administrators

 Hello guys, if you are a SQL database administrator a SQL Developer, a good knowledge of database tools can really help. It even been said that a craftsman is as good as his tools. So, you should spend some time and find out the tools which can help you with your job with respect to Database and SQL. Here are the main 10 free data set instruments that play out a great many explicit capabilities. The thought behind this rundown is to assist you with picking the right devices that best met your requirements.

10 Essential SQL Commands and Functions Every Developer should learn

Hello guys, if you are starting with SQL and wondering which commands you should learn first then you have come at the right place. In this article, I have shared 10 most essential SQL commands and functions which I believe every programmer should learn. This includes commands to pull data from database as well write data into data, update data, and remove data from database. While writing in the SQL language, you will utilize an assortment of SQL keywords to make explanations and questions. An assertion includes a series of characters and SQL keywords that adjusts to the designing and grammar rules of the language and may influence information or control processes corresponding to your information. 

Top 20 Kubernetes Interview Questions Answers for 1 to 3 Years Experienced

Hello guys, if you are preparing for Software developer or DevOps engineer Interview where Cloud Computing and Kubernetes skill are needed or mentioned in Job description then you should prepare for Kubernetes questions on Interviews. Kubernetes has quickly become an essential tool to deploy your application on Cloud and that's true not just for Java developers but also for Python, JavaScript, and Golang developers. If you already know the importance of Kubernetes and looking for common Kubernetes questions from interviews then you have come to the right place. Earlier, I have shared both Docker Interview questions and DevOps Interview Questions and in this article, I am going to share 20 common Kubernetes questions with answers.

How does Component Scanning works in Spring? @Configuration, @Component and @ComponentScan Example

Hello guys, if you are wondering how to does auto-wiring work in Spring Framework and how does Spring Framework find dependency in runtime then you have come to the right place. Earlier, I have explained How Spring MVC works and In this tutorial, I will tell you how component scanning and auto-wiring works in Spring. You will also learn how to enable component scanning in a Spring application. When you develop a software application using spring, you need to tell the Spring framework where to look for Spring components. Using component scanning it is very much easier as this enables auto-detection of beans by spring container and smoothly.

Top 15 HTML5 Interview Questions with Answers for 1 to 2 years Experienced

Hello guys, if you are preparing for web design or web development interview and looking for HTML 5 interview questions to revise key HTML 5 topics and concepts before interview then you have come to the right place. In the past, I have shared best HTML and CSS courses and in this article, I will share 15 common HTML 5 interview questions with answers for web design and web development interviews. You can use this list to quickly prepare for HTML 5 interviews. HTML is one of the three core technologies of the World Wide Web(WWW). It is the most essential part of a web application. Along with CSS and JavaScript, HTML is necessary to learn for web development. HTML is the easiest to learn and understand. 

13 Spring Boot Actuator Interview Questions Answers for 3 to 5 Years Experienced Java Developers

If you have used Spring Boot, you may know that Spring Boot is all about convenience, and the Spring Boot actuator is one of such features that provides a convenient way to interact with your app using HTTP and JMX. It's also essential from the Spring Boot interview point of view. While I did include some Spring Boot Actuator questions in my earlier post about frequently sked Spring boot interview questions, many of you asked for more questions to cover Spring Boot Actuator in depth, so I decided to write a separate article. In this article, we will see some popular Spring boot Actuator interview questions and, along the way, learn more about this helpful Spring boot Feature

How to convert String to Integer SQL and Database? MySQL, Oracle, SQL server and PostgreSQL Example

 Hello guys, if you are wondering how to convert VARCHAR to String in SQL then you are at the right place. In this article, we will cover various techniques to convert String to Integer in all databases - MySQL, Oracle, SQL server and PostgreSQL. To perform tasks or correlations or change between information in a SQL Server data set, the SQL information kinds of those values should coordinate. At the point when the SQL information types are unique, they will go through a cycle called type-projecting. The transformation of SQL information types, in this cycle, can be implied or unequivocal.

How to use EXISTS and NOT EXISTS in SQL? Microsoft SQL Server Example

Hello guys, if you are wondering how to use the IF EXISTS and NOT EXISTS in SQL then you are at the right place. Earlier, I have shared how to use GROUP BY, WHERE, and HAVING clause and in this tutorial I will share how to use exists and not exists clause in SQL. The IF EXISTS and NOT EXISTS commands in T-SQL are covered in depth in this article. When comparing data sets using subqueries, it also illustrates why EXISTS should be preferred over IN and NOT EXISTS over NOT IN. If you don't know, EXISTS is a logical operator in SQL that is used to check if rows in a database exist. If the subquery produces one or more records, it returns TRUE. The NOT EXISTS operator in SQL is the polar opposite of the EXISTS operator, and it is fulfilled if the subquery returns no results.

5 Essential Spring Cloud Annotations Java Programmer should Learn

Hello guys, If you are developing a Java application for Cloud, then you should learn Spring Cloud, a great framework and extension of the popular Spring framework, which can help you to develop a cloud-native Java application. Spring Cloud provides several necessary services required for a cloud-based Java application and Microservices like configuration management, service discovery, circuit breakers, intelligent routing, micro-proxy, a control bus, one-time tokens, global locks, leadership election, distributed sessions, cluster state, etc.

What is Normalization in SQL? 1NF, 2nd NF, and 3rd NF Example Tutorial

What is Normalization?
Normalization is the cycle to take out information overt repetitiveness and improve information uprightness in the table. Normalization likewise assists with coordinating the information in the data set. It is a multi-step process that sets the information into even structure and eliminates the copied information from the relational tables. Normalization coordinates the segments and tables of a data set to guarantee that data set integrity constraints appropriately execute their conditions. It is an orderly method of deteriorating tables to take out information overt repetitiveness (redundant) and unfortunate qualities like Insertion, Update, and Deletion anomalies.

What is @Bean Annotation in Spring Framework? Example Tutorial

Hello Java programmers, if you are wondering what is @Bean annotation in Spring Framework, what is the purpose, and how to use it then you have come to the right place. Earlier, I have shared the best free Spring core and spring MVC courses and In this tutorial, you will learn the most frequently used Spring annotations @Bean, which are used to define different types of beans. Beans are the fundamentals of Spring framework, they represent the POJO class which is created and managed by Spring Framework. Whole Spring framework is about beans and their relationships. 

Spring HelloWorld Example using Java Annotations and Autowiring

Spring framework has gone a couple of releases since I last share the Spring hello world example with XML configuration. In this article, I am going to explain to you how to create a Spring hello world example with Spring 4.2 release and by using Annotation for dependency injection and autowiring. So no more XML files to specify bean dependencies. It's a simple program that shows how you can use the Spring framework to create Services that are loosely coupled. The example will show you the basic concept of dependency injection by creating a simple Java application that greets the user.

What is @Conditional annotation in Spring Framework? Example Tutorial

Hello guys, if you want to know what is @Conditional annotation in Spring Framework and Spring Boot, and how to use it then you have come to the right place. Earlier, I have shared best free courses to learn Spring Framework and Spring Boot, and in this article, you'll learn what they are, how to use them with practical examples. Spring 4.0 introduced the @Conditional annotation that is used for conditional checking for bean registration. This annotation offers more support than the @Profile annotation provided by the spring framework and most of the Spring Boot matching is attributed to this annotation. It allows you to setup features based upon certain conditions like presence of a class in classparth or a JAR File which is how Spring Boot Auto-configuration works.

Difference between @Component, @Service, and @Repository Spring Annotations - Java

Hello guys if you are wondering what is the difference between @Component, @Service, and @Reposistory annotation in Spring Framework then you have come to the right place. In the past, I have shared 15 Spring Boot Interview Questions and 30 Spring MVC questions and in this article, I am going to answer the fundamental and popular Spring questions about @Component, @Service, and @Repository annotation, but before we go into differences, let's understand the similarity first. All three of them are used to make a Java class a Spring bean, something which is managed by Spring Framework. 

@SpringBootTest integration test Example Java

When we talk about spring boot integration testing, we're talking about launching an application in ApplicationContext and performing tests. For integration testing, Spring Framework has a specific test module. It's referred to as a spring test. If we're going to utilize spring-boot, we'll need to use spring-boot-starter-test, which uses spring-test and other dependencies inside.

We'll look at how to perform integration tests for a Spring Boot application in this post.

First of all, let's understand what integration testing is and what to test as part of integration testing in Spring.

How to use lsof command in Linux? Example Tutorial

Hello guys, If you want to learn how to use lsof command in Linux then you have come to the right place. In the last few article, I talk about find, grep, mailx, crontable and du command in Linux and in this article I am going to talk about another useful Linux command, the lsof command. The lsof  command lists open files and that's why its named lsof. This command is very important for server side developer and IT support people who need to check which file is held by which process and find the deleted files which are hogging memory etc. It act as a useful debugging and troubleshooting tool in Linux.

How to Synchronize HashMap in Java? Collections.synchronizedMap() Example Tutorial

Hello guys, if you have used HashMap class in Java before than you will know that HashMap is not synchronized, which means you cannot use it on multi-threaded Java programs without external synchronization. In other words, if you share an instance of HashMap between multiple threads, where each of them is either adding, removing or updating entries then it's possible that HashMap may lose its structure and not behave as expected. In simple words, exposing HashMap to multiple threads can corrupt the Map and you may not able to retrieve the data you want. If you have read my earlier article about HashMap, you know that during re-sizing its possible that HashMap exposed to multiple threads, may end up in an infinite loop. 

Difference between WeakHashMap , IdentityHashMap, and EnumMap in Java?

Hello guys, if you are wondering what is the difference between WeakHashMap, IdentityHashMap, and EnumMap in Java then you are at  the right place. In last article, we have seen difference between HashMap, TreeMap, and LinkedHashMap in Java and in this article we will difference between WeakHashMap, EnumMap, and IdnetityHashMap in Java. Apart from popular implementation like HashMap and LinkedHashMap, java.util.Map also has some specialized implementation classes e.g. IdentifyHashMap which uses == instead of equals() method for comparing keys, WeakHashMap which uses WeakReference to wrap the key object and a key/value mapping is removed when the key is no longer referenced from elsewhere, and EnumMap where keys are Enum constants. 

How to Execute threads in order in Java - Join Example

Sometime we need to execute multiple threads in a particular order e.g. if we have three threads T1, T2 and T3 and we want to execute them in a sequence such that thread 2 starts only when first thread finishes it job and T3 starts after T2, but with multithreading in Java there is no guarantee. Threads are scheduled and allocated CPU by thread scheduler which you cannot control but you can impose such ordering by using Thread.join() method. When you start a thread its not guaranteed that which thread will start first and whether the thread started first will finish first, if your application's logic depends upon a sequence its better to do all those operation on single thread because if all code is confined to one thread it will execute in order they were written provided some JIT optimization.

How to sort a Map by keys in Java? TreeMap and HashMap Example

So you have a Map in your Java program and you want to process its data in sorted order. Since Map doesn't guarantee any order for its keys and values, you always end up with unsorted keys and Map. If you really need a sorted Map then think about using the TreeMap, which keeps all keys in sorted order. This could be either natural order of keys (defined by Comparable) or custom order (defined by Comparator), which you can provide while creating an instance of TreeMap. If you don't have your data in a sorted Map then the only option that remain for you is to get the keys and values, sort them and then process your Map in that order. 

Java HashMap keySet() , entrySet and values() Example - Tutorial

The java.util.Map interface provides three methods keySet(), entrySet() and values() to retrieve all keys, entries (a key-value pair), and values. Since these methods directly come from the Map interface, you can use them with any of the Map implementation classes e.g. HashMap, TreeMap, LinkedHashMap, Hashtable, ConcurrentHashMap, and even with specialized Map implementations like EnumMap, WeakHashMapand IdentityHashMap. In order to become a good Java developer, it's important to understand and remember key classes of Java API like Java's Collection framework.

10 Examples of HashMap in Java - Programming Tutorial

The HashMap in Java is one of the most popular Collection classes among Java programmers. After my article on How HashMap works in Java, which describes the theory part of Java HashMap and becomes hugely popular among Java programmers, I thought to share how to use HashMap in Java with essential and fundamental HashMap examples, but couldn't do that earlier and it was slipped but today we are here with all the HashMap examples about getting values to checking if a key exists in Map, I am going to share everything a Java developer should know about HashMap. The HashMap is a data structure, based on hashing, which allows you to store an object as a key-value pair, an advantage of using HashMap is that you can retrieve objects on constant time i.e. O(1) if you know the key.

10 examples of crontab commands in Linux

In Today's article, You shall be learning the 10 examples of crontab commands in Linux. The Objectives are : what is the meaning of cron, what it is used for and when is it used in Linux.

Now, What is ‘crontab’ Command

Crontab command is derived from cron table and can also be referred to as that. Cron schedule jobs that is time based. Cron jobs are used to executes tasks at scheduled intervals.

The cron table syntax command has six fields that is separated by space. Now we shall be checking it one by one.

How to convert a Map to List in Java? HashMap to ArrayList Example

Before converting a Map to a List in Java,  we should be very clear about these data structures which are widely used in Java. So let's begin with Map. What is Map? Map is an Interface in Java which store key and value object. It's a Java representation of a popular hash table data structure that allows you to search an existing element in O(1) time, at the same time also makes insertion and removal easier.  We use a key object to retrieve the value object by using hashing functionality provided by Map. As we have seen in how the get method of HashMap works, In Java, the equals() and hashcode() methods are an integral part of storing and retrieving objects from it. The map allows duplicate values but no duplicate keys.

What is static and instance Method in Java? Example Tutorial

Hello guys, if you have trouble understanding what is static method in Java and how to use it then you are at the right place. In this article, I will share everything I have learned bout static method in my 20 years of Java experience. Static methods are one of the important programming concepts in any programming language but unfortunately, it is also the most misunderstood and misused one. Talking about Java, almost all programmers know that. static methods belong to the class and non-static methods belong to the objects of the class, but hardly all of them understand what it means. That's why this is one of the popular weed-out questions on programming interviews. 

How to use Lambda Expression and method reference in Java? Example Tutorial

Hello guys, if you are wondering what is lambda expression and method reference in Java then you are at the right place. Earlier, I have shared 10 Stream API examples and in this article, I will share everything I know about Lambda expression with you. The Lambda expression is one of the most important features of Java 8 which has opened a whole new dimension of programming paradigm in Java. It is the feature which made the Functional Programming possible in Java because now you can pass the code to a function to execute as opposed to an object. You might be a bit surprised but if you look from a developer's point of view, it is nothing but a way to pass your code to a method in Java.

Difference between HashMap vs TreeMap vs LinkedHashMap in Java

Hello guys, if you are wondering when to use HashMap, TreeMap and LinkedHashMap in Java and want to understand difference between them then you are at the right place. Earlier, I have shared difference between HashSet, TreeSet, and LinkedHashSet and in this article, I will explain the difference between these three common Map implementation HashMsp, TreeMap, and LinkedHashMap. Though all three classes like HashMap, LinkedHashMap and TreeMap are implementation of java.util.Map interface, there is some functional difference between them. Perhaps most notable difference between them comes from their iteration order. HashMap makes absolute no guarantee about in which order you can iterate their keys, any application depending upon iteration order of HashMap is fragile, because it can change anytime. In fact, in Java 7, iteration order of HashMap is different than Java 6. 

3 Examples to Convert Date to LocalDate in Java 8? Tutorial

One of the great features of Java 8 is the new Date and Time API which is intended to fix existing issues related to mutability and thread-safety with existing java.util.Date class. But given java.util.Date is used very heavily across all the Java applications, you will often end up with a situation where you need to convert java.uti.Date to java.time.LocalDate while working in Java 8. Unfortunately there is no toLocalDate() method in the java.util.Date class. Though, you can easily convert Date to LocalDate if you are familiar with how new and old API classes map to each other.

Composite Design Pattern Example in Java and Object Oriented Programming

Hello guys, if you are wondering how to use Composite design pattern in Java then you are at the right place. Composite design pattern is another object oriented design pattern introduced by Gang of Four in there timeless classic book Design pattern : Elements of Reusable software. Composite pattern as name suggest is used to compose similar things together, like similar objects. It implements an interface and also contains other objects which implements the same interface, also known as containee. One of the best example of Composite pattern from Java standard library is Swing's container classes e.g. Panel, which not only are Components by themselves, but also contains other components like JButton, Label, JTable etc. 

6 Advanced Comparator and Comparable Examples in Java 8

The JDK 8 release has completely changed the way you compare objects and sort them in Java. The new features of the Java 8 language e.g. lambda expression and method reference have made it easier to implement both Comparator and Comparable interface, as you don't need an Anonymous class for inline implementation. Now, you can create Comparators in just one line by using lambdas and method reference as we'll see in this article. Other features like providing default and static methods on interfaces have also made a huge difference when it comes to Comparator. They helped Java API designers to redesign and evolve existing interfaces, which wasn't possible earlier without breaking existing clients of those interfaces.

How to convert String to long in Java? Example

You can parse a String literal containing valid long value into a long primitive type using parseLong() and valueOf() method of java.lang.Long class of JDK. Though there is a couple of difference between valueOf() and parseLong() method e.g. valueOf() method return a Long object while parseLong() method return a Long object, but given we have autoboxing in Java, both method can use for parsing String to create long values. In the last article, you have learned how to convert a Long value to a String in Java, and in this tutorial, you will learn the opposite, i.e. how to parse a String to a long value in Java

How to convert String to Double in Java and double to String with Example

There are three ways to convert a String to double value in Java, Double.parseDouble() method, Double.valueOf() method and by using new Double() constructor and then storing the resulting object into a primitive double field, autoboxing in Java will convert a Double object to the double primitive in no time. Out of all these methods, the core method is parseDouble() which is specially designed to parse a String containing floating-point value into the Double object. Rest of the methods like valueOf() and constructor uses parseDouble() internally. This method will throw NullPointerException if the string you are passing is null and NumberFormatException if String is not containing a valid double value e.g. containing alphabetic characters.

How to check if two String variables are same in Java? equals(), equalsIgnoreCase() and == operator Example

There are multiple ways to compare two strings alphabetically in Java e.g. == operator, equals() method or compareTo() method, but which one is the best way to check if two strings are equal or not? Programmers often confused between == operator and equals() method, and think that comparing strings using == operator should be faster than equals() method, and end up using that. Though they are not completely wrong, they often missed the point that == operator is designed to compare object equality, not String equality, which is actually defined in equals()method and compare Strings alphabetically. 

ArrayList.contains(), size(), clear, asList(), subList(), toArray(), and isEmpty() Example in Java

Java ArrayList Example
ArrayList in Java is one of the most popular Collection classes. ArrayList is an implementation of the List interface via AbstractList abstract class and provides an ordered and an index-based way to store elements. Java ArrayList is analogous to an array, which is also index-based. In fact, ArrayList in Java is internally backed by an array, which allows them to get constant time performance for retrieving elements by index. Since an array is fixed length and you can not change their size, once created, Programmers, starts using ArrayList, when they need a dynamic way to store object, i.e. which can re-size itself. See the difference between Array and List for more differences. 

How to Read User Input and Password in Java from command line? Console Example

Hello guys, if you are wondering how to take user input from command prompt in Java like username and password then don't worry. Java provides several utilities like Scanner and BufferedReader to read input from command prompt in Java. Java 6 added a new utility class for reading input data from character based devices including command line. java.io.Console can be used to read input from command line, but unfortunately, it doesn't work on most of the IDE like Eclipse and Netbeans. As per Javadoc call to System.Console() will return attached console to JVM if it has been started interactive command prompt or it will return null if JVM has been started using a background process or scheduler job.

How to replace characters and substring in Java? String.replace(), replaceAll() and replaceFirst() Example

One of the common programming tasks is to replace characters or substring from a String object in Java. For example, you have a String "internet" and you want to replace the letter "i" with the letter "b", how do you that? Well, the String class in Java provides several methods to replace characters, CharSequence, and substring from a String in Java. You can call replace method on the String, where you want to replace characters and it will return a result where characters are replaced. What is the most important point to remember is that the result object would be a new String object? 

Where Is Python Used In The Real World?

Hello guys, if you are wondering where is Python used in real world before you decide whether to learn Python programming language or not then its actually a good question. While everyone is talking about Python's popularity, it make sense to do research and find out which industries in Software development is using Python as their primary language. You will be surprised to know that like Java Python is also almost everywhere. Python is now used in Artificial Intelligence, Web Development, Game Development, Building Desktop and UI Apps, Machine Learning, Data Science, Data Analysis, Building Mobile apps, Web Scrapping, and most importantly on Automation. So, you can see that Python is widely accepted and used and learning Python is the best decision you can take to start your career as Software Developer.

How to use @PropertySource Annotation in Java and Spring? Property Source Example

Hello Java developers, if you are wondering What is property source in Spring Framework and how to use @PropertySource annotation then you have come to the right place. Earlier, I have shared the best books and online courses to learn Spring Framework and in this article, I will teach you how to use @PropertySource annotation in Spring to read Environment variables and inject properties using @Value annotation. In the Spring application, one of the files that are needed to provide properties to the Spring environment is the @Configuration classes. 

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

Hello guys, if you are preparing for a JavaScript developer or web developer and looking for common Node.js questions to prepare for interviews then you are at right place. In the past, I have shared JavaScript interview questions, React Questions, Angular Questions and even web development questions and in this article, I am going to share frequently asked Node.js questions with answers for interviews.  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.

Difference between StringBuilder and StringBuffer in Java with Example

If you are in a hurry and heading straight to interview then I won't take much of your time, In a couple of words, the main difference between StringBuffer and StringBuilder is between four parameters, synchronization, speed, thread-safety, and availability. StringBuffer is synchronized and that's why thread-safe, but StringBuilder is not synchronized, not thread-safe and that's why fast. Regarding availability, StringBuffer is available from Java 1.0 while StringBuilder was added in Java 5. 

How to check if a Number is Power of Two in Java? [Bitwise AND Example]

Hello guys, if you are thinking about how to check if a given number is a power of two without using an arithmetic operator like division then you have come to the right place. In Java, you can use bitwise operators like bitwise AND check if a given number if the power of two or if the given number is even or odd. In this Java Programming tutorial, you will learn how to check if the number is the Power of two using a bitwise operator. The main purpose of this program is to teach you how to use bit-wise operators like bitwise AND (&)  in Java. A number is said to be the power of two if all its prime factors are 2, but in the binary world, things work a little differently. 

Top 20 Java Access Modifier Interview Questions Answers for 1 to 2 Years Experienced

Access modifiers is one of the essential concept in Java and every programmer should be familiar with, and because of its importance, its also a popular topic in Java interviews. Access modifier can be applied to class, method, fields, and variables and as the name suggests they control the access. Like who can access that particular class, method or variable. For example, public modifier provides universal access which means any public class, method or variable is accessible by everyone and everywhere. In other words, you can access a public class both within the package and outside the package. 

How to convert an ArrayList to Array in Java? ArrayList of String Example

Hello guys, if you are wondering how to convert an ArrayList of objects to an array of Object in Java then you have come at the right place. In this article, I will show you a couple of ways to convert an ArrayList to Array in Java. For example, you can start with creating a new array and then copying elements from ArrayList to array, or you can also use use Stream to go through all elements of ArrayList and then collect result in an array. In this example, we will use Arrays.copyOf() method to convert a given ArrayList to array in Java. This method can be used to convert any ArrayList like ArrayList of Integer, String or any custom object to Array in Java. 

How to Delete Objects from ArrayList in Java? ArrayList.remove() method Example

Hello guys, if you are wondering how to remove an element from a given ArrayList in Java then you are at right place. Earlier, I have shared how to sort ArrayList in Java as well how to loop over ArrayList in Java and In this Java ArrayList tutorial, you will learn how to remove elements from ArrayList in Java e.g. you can remove String from ArrayList of String or Integer from ArrayList of Integers. There are actually two methods to remove an existing element from ArrayList, first by using the remove(int index) method, which removes elements with a given index, remember the index starts with zero in ArrayList.

5 Difference between Hashtable vs HashMap in Java? Answer

Hashtable vs HashMap in Java
Hashtable and HashMap are two hash-based collections in Java and are used to store objects as key-value pairs. Despite being hash-based and similar in functionality there is a significant difference between Hashtable and HashMap and without understanding those differences if you use Hashtable in place of HashMap then you may run into series of subtle programs which is hard to find and debug. Unlike the Difference between ArrayList and HashMap, Differences between Hashtable and HashMap are more subtle because both are similar kinds of collections. Before seeing the difference between HashMap and Hashtable let's see some common things between HashMap and Hashtable in Java.

How to write a Parameterized Method in Java using Generics? Example

Hello guys, if you are wondering how to write a parameterized method in Java using Generics then you are at right place. Earlier, I  have shared Complete Java Generics tutorial as well as popular Generics Interview Questions and in this article, I will teach you how to write a parameterized method using Generics in Java step by step. A method is called a generic method if you can pass any type of parameter to it and it will function the same like it allows the same logic to be applied to different types. It's known as a type-safe method as well.

10 Examples of nslookup command in Linux and Windows

Hello guys, if you are wondering what is nslookup command and how to use in Linux and Windows then you are at right place. In the past, I have shared examples of crontab, find, grep, netstat, and curl command and In this article, I will share 10 different examples of nslookup command, each using its different powerful command line option to give you the tool you need to deal with networking  related queries. I often use nslookup command to convert a given IP address to hostname or a given hostname to IP address. For example, when I see an IP address in our log file and want to find which host that request is coming from, I use nslookup. 

Difference between Static and Dynamic binding in Java

Hello guys, if you are wondering what is difference between static and dynamic binding and how it affect your program execution in Java then you are at right place. When you call a method in Java, it is resolved either at compile time or at runtime, depending upon whether it's a virtual method or a static method. When a method call is resolved at compile time, it is known as static binding, while if method invocation is resolved at runtime, it is known as Dynamic binding or Late binding. Since Java is an object-oriented programming language and by virtue of that it supports Polymorphism. Because of polymorphism, a reference variable of type Parent can hold an object of type Child, which extends Parent.

Difference between Polymorphism vs Inheritance in Java and Object Oriented Programming - Example

Programmers often confused among different object-oriented concepts e.g. between Composition and Inheritance, between abstraction and encapsulation, and sometimes between Polymorphism and Inheritance. In this article, we will explore the third one, Polymorphism vs Inheritance. Like in the real world, Inheritance is used to define the relationship between two classes. It's similar to the Father-Son relationship. In object-oriented programming, we have a Parent class (also known as the superclass) and a Child class (also known as the subclass). Similar to the real world, a Child inherits Parents' qualities, like its attributes, methods, and code. 

How to convert ArrayList to Comma Separated or Delimited String in Java - Spring Example

Some time we need to convert ArrayList to String in Java programming language in order to pass that String to stored procedure, any method or any other program. Unfortunately Java collection framework doesn't provide any direct utility method to convert ArrayList to String in Java. But Spring framework which is famous for dependency Injection and its IOC container also provides API with common utilities like method to convert Collection to String in Java. You can convert ArrayList to String using Spring Framework's StringUtils class. StringUtils class provide three methods to convert any collection e.g. ArrayList to String in Java, as shown below:

10 Examples of head and tail command in Linux

Hello guys, if you are wondering how to use head and tail command in Linux then you have come to the right place. Both head and command are great tool to view content from files in Linux. As the name suggest, "head" is used to view the top portion of the file and "tail" is used to see the file content from bottom. For example when you say "head data.json" then it will display first 10 lines of the file and when you say "tail data.json" then it will display last 10 lines of the file. As a Java developer, I find myself using tail more often than head while checking logs. As you can use tail to see the last few lines of the log file and you can also use tail -f application.log to see the logs rolling in real time. I often use this command to track request and see what application is doing at a particular time. 

Difference between JDK and JRE in Java Platform

Java Platform offers JRE and JDK to run Java programs. JRE stands for Java runtime environment and JDK stands for Java development kit. JRE is meant for normal users, who wants to run Java program in their computer. JRE is normally used to run Java programs downloaded over internet e.g. Java Applets and Java Desktop application built using AWT and Swing. The main difference between JRE and JDK, comes from the fact that they are different tools. JDK is created for Java programmers and contains tools required for Java programming, like javac for compiling Java source files to .class files. Without JDK, you can not create Java applications and programs. 

Difference between this and super keywords in Java

this and super are two special keywords in Java, which is used to represent current instance of a class and it's super class. Java Programmers often confused between them and not very familiar with there special properties, which is asked at various core Java interviews. A couple of questions, which I remember about this and super keyword is  that, Can we reassign this in Java?  and the difference between this and super keyword in Java. Do you want to try that? Ok, I am not giving the answer now, rather I will let you know the answer at the end of this post. 

10 Examples of more and less command in Linux

Hello guys, if you have been working on Linux then you must have come across less and more commands. They are the most popular command to view content of a file, particular log file in Linux.  In fact, less is my favorite command to see the logs in Linux because you can open both normal log file as well as a gzip or compressed log file using less command for viewing. It's also very well designed and fast command and you easily open even large log files using less which you would otherwise struggle to open using Windows tool like Notepad or Notepad++.  In the past, I have shared examples of lsofcurl, netstat, and ssh command and in this article, I am going to share common examples of both less and more command.

How to use String literals in switch case in Java? Example Tutorial

Switch Statements are not new for any Programmer, it is available in C, C++, Java and in all major programming language. The switch statement in Java allows you to a clear, concise, and efficient multiple-branch statement without lots and lots of messy if-else statements. But Java Switch and case statement have a limitation, you cannot use String in them. Since String is one of the most used classes in Java, and almost every program, starting from Hello World to a complex multi-tier Java application uses them, it makes a lot of sense to allow them in the Switch case. In Java 6 and before, the values for the cases could only be constants of integral type e.g. byte, char, short, int, and enum constants. If you consider Autoboxing then you can also use the corresponding wrapper class like Byte, Character, Short, and Integer.

10 Example of SSH Command in UNIX and Linux

SSH command stands for Secure Shell which allows user to securely login into remote machine. If you are working on network on UNIX and Linux machine, SSH command is your friend because with ssh in UNIX you can not easily navigate from one host to other. SSH Command or SSH client in UNIX not only allow you to login into remote host but also allows you to execute command on remote machine without going to into remote server. which is quite convenient while writing bash scripts or getting general information about server like uptime of remote server. This article shows examples of ssh command in UNIX and different usage of ssh in UNIX along with basic concept of ssh command.

10 Examples of wget command in Linux

Hey there! Today's article will explain the "wget" command in Linux and 10 different examples. If you are a Linux user, this is a command you will commonly use almost every now and then.

WHAT IS THE "WGET" COMMAND?

Wget emanated from the GNU project. It is a non-interactive tool used to download files from the web. It is called non-interactive because it does not need human interaction before it operates. the user does not have to log on before it works.  This means that it works in the background. Wget supports HTTP, HTTPS, FTPS,SFTP.

"wget" is very beneficial in such a way that, If you are downloading a file and unfortunately the network connection becomes unstable and slow, It keeps retrying until the file is fully recovered. 
Before you can start using "wget" command, you must have installed that on your Linux. if not It won't recognize that command if you type it.

10 Examples of netstat command in Linux and UNIX

Hello guys, if you are wondering how to check which application is listening to a particular port or wondering what are active UDP and TCP post on your machine then don't worry, you can use the "netstat" command in Linux to get these details. Along with lsof and curl, netstat is another important utility command which I use on almost daily basis as a server side Java developer. Since most of the application I create follow client server model and most of them run on Linux, I often use netstat command during post implementation checks and troubleshooting during any production issue.

How to Fix java.lang.ArrayIndexOutOfBoundsException in Java [Solution]

The ArrayIndexOutOfBoundsException, also known as java.lang.ArrayIndexOutOfBoundsExcepiton is one of the most common errors in Java programs. It occurs when a Java program tries to access an invalid index like. an index that is not positive or greater than the length of an array or ArrayList. For example, if you have an array of String like String[] name = {"abc"} then trying to access name[1] will give java.lang.ArrayIndexOutOfBoundsException: length=1; index=1 error because index 1 is invalid here. Why? because the index in the Java array starts with zero rather than 1, hence in an array of just one element the only valid index is index zero. 

10 Examples of ls command in Linux

Hey there, if you are wondering how to check what inside a directory or just wondering what is ls command in Linux and how to use it to list files then you have come to the right place. Earlier, I have shared examples of df command, du command, find command, grep command, tar command and chmod command and in  today’s article we shall be looking at 10 different examples of ls command in Linux. But before then you would need the meaning of ls and what it is being used for. The goal of this article is to get you comfortable with different things you could do with the ls command and this articles would show you in details how to use it, when to use it and it’s benefits. Let’s go

Top 25 Java Error and Exception Interview Questions Answers

1) The difference between checked and Unchecked Exceptions in Java?
For checked exceptions, the compiler ensures that they are either handled using try-catch, try-finally, or try-catch-finally block or thrown away. If a method, which throws a checked exception like IOException, and doesn't handle them or doesn't declare them in the throws class of the method, a compile-time error will occur. On the other hand, the compiler doesn't do similar checks for an unchecked exception, that's why it is known as un-checked. These are also called runtime exceptions because they extend java.lang.RuntimeException.

[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.

10 Reasons of java.lang.NumberFormatException in Java - Solution

The NumberFormatException is one of the most common errors in Java applications, along with NullPointerException. This error comes when you try to convert a String into numeric data types e.g., int, float, double, long, short, char, or byte. The data type conversion methods like Integer.parseInt(), Float.parseFloat(), Double.parseDoulbe(), and Long.parseLong() throws NumberFormatException to signal that input String is not valid numeric value.