[Solved] How to check if two String are Anagram in Java? Example

Hello guys, if you are preparing for Coding interviews then you already know that String is one of the most popular topics. You will be bound to get some string-based coding problems on interviews. If not, you have come to the right place becuase we'll look at one of the most popular String programming interview questions today,  how to check if two given strings are Anagram of each other? Two String is said to be an anagram of each other, if they contain exactly the same characters but in a different order. For example "ARMY" and "MARY" are an anagram of each other because they contain the exact same characters 'A', 'R', 'M' and  'Y'.

How to create a String or int Array in Java? Example Tutorial

There are several ways to create an array in Java, for example, you can declare the array without initializing it, or you can create and initialize the array in the same line. If you want to make an array with values, then you need to first decide which type of array you want to create? e.g., do you want a String array, which can contain String objects like "abc," "def," or do you want to create an int array that contains int values like 10, 20, etc. In Java, you can create an array of any type, including primitives like byte, int, long, and objects like String, Integer, and other user-defined objects. Let's some code to make a new array in Java.

How to use Map.compute(), computeIfPresent() and ComputeIfAbsent in Java? HashMap and ConcurrentHashMap Example

The JDK 8 has added several useful methods in existing interfaces e.g. java.util.Map, java.util.Collection, and java.util.concurrent.ConcurrentMap. Thanks to default methods, the much-needed evolution of existing interfaces becomes possible. Out of many useful methods, one method which stands out to me is the compute() method, which allows you to update a value in ConcurrentHashMap atomically. As per Java documentation, The compute() function tries to compute a mapping for the specified key and its current mapped value (or null if there is no current mapping). The entire function is performed atomically.

How to get First and Last Element of LinkedList in Java [Example]

Hello guys, if you are wondering how to get the first and last element from Java LinkedList then you have come to the right place. Earlier, I have shared the best Data structure and algorithms courses and in today's post, I will teach you how to get the first and last element of a linked list in Java. This is one of the common coding problems but we will see it from different angles. In Java, you don't need to write and create your own LinkedList, there is a built-in class called java.util.LinkedIn and you can use that class whenever you need a linked list data structure. 

Top 20 Unity Interview Questions and Answers for Game Developers

Hello guys, if you are preparing for Game Developer interviews where Unity or Unity 3D is listed as main skill then you must prepare Unity Interview Questions. If you already looking for Game Developer Interview questions and Unity questions for interviews then you have come to the right place. Earlier I have shared 20 Unreal Engine Interview Questions and in this article, I am going to share 20 Unity 3D Interview Questions with answers. If you have worked in Unity 3D then you can easily answer these questions but if you struggle to answer them then I also suggest you to checkout these Unity online courses to refresh your knowledge about Unity and the benefits it offer. Interviews are often difficult to crack because of vast variety of questions but knowing essential Unity concepts and best practices always helps.

Top 20 Unreal Engine Interview Question and Answers for Game Developers

Have you been having sleepless nights just because of the Unreal Engine interview that is ahead of you? Being in this situation is unavoidable especially after you have experienced problems during your previous interviews or you totally do not know what is required of you when it comes to Unreal Engine interview. Time for being in such a situation is now a thing of the past because right in this article you are going to know the kind of questions that are usually asked in this kind of interview and this will open up your eyes and you will be more than prepared when that day comes.  In this article, I am going to share 20 common Unreal Engine Interview questions for game developers to revise key concepts and get ready for interviews. If you have used Unreal Engine before then you can easily answer these questions but if you struggle then I suggest you to join one of these best Unreal Engine online courses to learn and revise key concepts in quick time.

Top 30 Spring Core, Spring MVC and Spring Security Interview Questions Answers

Spring Interview Question is one of the first things Java programmers should prepare before appearing on any Java or Spring interview. With the immense popularity of Spring frameworks like Spring MVC and Spring Boot in the Java world, the focus on Spring skills on interviews increases daily. For those who don't know, the Spring framework is one of the most famous structures for Java applications, which aims to simplify Java development. It revolutionized the Java development when it initially came with concepts of  Dependency Injection and Inversion of Control, which made writing a testable and maintainable Java application

Difference between Thread.yield and Thread.sleep in Java? Answer

Sleep vs yield in Java
Sleep and yield are two methods that are used to get CPU back from Thread to Thread Scheduler in java but they are completely different than each other. The major difference between Sleep vs yield is that sleep is more reliable than yield and it's advised to use sleep(1) instead of yield to relinquish CPU in multi-threaded Java applications to give an opportunity to other threads to execute. In this Java tutorial, we will what are the differences between yield and sleep in Java. But before seeing the difference between sleep and Yield let's see some similarities between yield and sleep in Java

Top 10 Projects You can Build to Learn Spring Boot in 2024

Hello guys, I have always said that there is no better way to learn anything then actually doing it and its 100% true for Spring Boot, one of the popular Framework for Java application Development. In my 20 years of experience, I have found that the best way to learn Java and Spring Boot is building projects. When you build project, common task surface them like creating a List or sorting a List and then you research and learn. Those learning stuck and make you better developer. Building project also have many advantage like it allows you to use a lot of technologies like Git, IntelliJIDEA, Hibernate, APIs etc together to build something which you can showcase to your potential employer. 

When to use PUT or POST in a RESTful API and Web Service? Answer

Hello guys, if you are confused about whether to use PUT or POST for updating a resource using RESTful web service then you have come to the right place. In the past, I have shared the best RESTful web service books and courses and today, I am going to share some tips to choose between PUT and POST while designing your RESTful web services. Btw, you are not alone, one of the most common confusion among web developers is the choice of PUT or POST HTTP method for creating and updating a resource while developing RESTful Web Services. Since both can be used to submit data, you can use either POST or PUT to create or update a resource.
 

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

How to fix org.springframework.beans.factory.BeanCreationException: Error creating bean with name X [Java Spring]

If you are using the Spring framework in your Java application and getting this error during startup it means Spring is not able to initialize the bean X and add it into its application context, Why? There could be multiple reasons like a typo on the spring bean name. Let's take a closer look at the stack trace to find out the real reason:

BeanInstantiationException: Could not instantiate bean class [X]: No default constructor found; nested exception is java.lang.NoSuchMethodException: X.()

Here X is the class, which is declared as Spring bean. The error clearly says that the default constructor is not present in class X.

Difference between Serializable vs Externalizable in Java - Interview Question

What is the difference between Serializable and Externalizable in Java is famous core Java interview questions and for some of them its one of those difficult Java question, which no one wants to see in Java interview. I was in that category until I read Effective Java and explored How Serialization works in Java and find out more about the Serialization process. What makes Serialization questions tricky is, Serialization as a persistence mechanism is not very popular. Many programmers prefer databases, memory-mapped files, or simple text files over Serialization. But Serialization has a distinguished advantage over these mechanisms.

What is the use of DispatcherServlet in Spring MVC? Interview Question Example

Hello guys, In today's article we are going to discuss one interesting and the important Spring MVC concept, which is also a popular Spring Interview question. How DispatcherServlet works internally in Spring MVC or What is the role of DispatcherServlet in Spring MVC are some of the frequently asked Spring MVC Interview Questions. You might have seen them already during your previous Java web development interviews but if you have not, it's a good question to know. In this article, I'll answer these questions by explaining What is DispatcherServlet and its importance in Spring MVC. The DispatcherServlet is one of the important components of the Spring MVC web framework and acts as a Front Controller.

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. 

Top 53 Java Programs for 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. 

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.

Difference between JIT and JVM in Java? Answered

The main difference between JIT and JVM is that JIT is part of JVM itself and its main function is to improve the performance of JVM by directly compiling some hot code (code that executes above a certain threshold) into native instruction. JIT stands for Just In time compilation and JVM stands for Java Virtual Machine. JVM is a virtual machine used in Java programming platforms to execute or run Java programs. The main advantage of JVM is that JVM  makes Java platform-independent by executing bytecodes. Java source code is compiled into class files, which contain bytecode.

Top 10 Programming Languages to Learn in 2024 [UPDATED]

Hello guys, we're just one week away from 2024. This is when most of us start making our goals like physical goals, educational goals, and financial goals. As a programmer, one of our goals is to learn new technologies and programming languages, but which languages should you learn? Since acquiring a programming language requires both time and patience, you should learn a language worth the effort; I mean., it can reward you with a better job and career growth. In this article, I will share with you the top 10 programming languages you can learn in 2024 to get a job in your favorite companies like Google, Microsoft, and Facebook.

Top 11 JavaScript Frameworks and Libraries to Learn in 2024 - Best of Lot

There is no doubt that JavaScript is now the #1 programming language in the world and also the king of web development. If you want to become a web developer who can quickly create websites like you see on the internet, then a good knowledge of JavaScript and various, popular JavaScript web development frameworks is essential for you. These frameworks have completely changed the way people developed web applications a decade ago. After node.js, it's even possible to create a complete web application from front to back using just one programming language, JavaScript. That's why it has become the preferred programming language of all Full-stack Web Developers.

Top 10 Google Cloud Certifications You can Aim in 2024 - Best of Lot

Hello guys, If you are aiming for Cloud Certifications in 2024 then Google Cloud Platform is one of the most in-demand platforms to go for. It's backed by Google and there is a huge demand for people who know Google Cloud Platform or have some experience in using Google Cloud Platform for DevOps, Machine Learning, and Big Data. Getting certified is a good way to learn both essential skills and get recognition and that's why I am sharing the 10 best Google Cloud computing certifications you can aim for in 2024.  

10 Projects You can Build to Learn TypeScript in 2024 - Best of Lot

Hello guys, if you want to learn TypeScript then there is no better way to learn then building projects. In my 20 years of experience in Software development, this is the most valuable lesson I have learned. Its Ok to read books and watch online courses but until you build something those knowledge will go in vain. You will forget most of them within few weeks. That's why its important to build project and keep building them. If you are looking for interesting TypeScript project ideas then you have come to the right place. Earlier, I have shared best TypeScript courses and best JavaScript courses and in this article, I am going to share 10 projects you can build to learn TypeScript in 2024. I have carefully chose these projects so that both beginner and intermediate TypeScript developer can benefit.