Java Comparator Multiple Fields Example | Comparator Chaining in Java 8 using Comparing() and thenComparing()

One of the common requirements in Java is to compare objects by multiple fields. For example, if you have a list of CreditCard objects and you want to compare them by their provider and credit limit I mean, first compare them by their providers like VISA, Master, or American Express and if they are from the same provider then compare them by their credit limit, also known as breaking ties. Before Java 8 this wasn't easy because you have to write nested codes to compare multiple fields of an object as there was no easy way to chain multiple Comparators in Java, but things have changed a lot from Java 8.

Top 40 Advanced Java Interview Questions Answers for 3 to 5 Years Experienced Programmers

Hello guys, if you are going for a Java support engineer interview and looking for some frequently asked questions then you have come to the right place. I have shared many posts about Java interview questions in the past but nothing, particularly from the support engineer perspective. Since there are a lot of L1 and L2 support job exists in BFSI (Banking, Finance, and Insurance Industry) and they are also for the longer term, I decided to write this post. In this article, I will share questions to help with technical aspects like the essential skills you need to clear a support engineer interview.

Top 5 Courses to learn System Design and Software Architecture in 2021 - Best of Lot

Software design or System design is one of the tricky concepts to master. You can quickly learn a programming language like Java or Python, but creating software using that programming language is a totally different thing. That's where software design and coding skills come to the rescue. It's actually an art to structure your program, design your modules, specify boundaries and interactions with other parts of the system so that they are easier to read, maintain, and flexible to change. It's one of the most essential skills for a software developer but often gets ignored. If you look for an online course to learn Software design and architecture, you won't find many, forget about good ones.

How to solve java.lang.NoClassDefFoundError: org/springframework/beans/factory/SmartInitializingSingleton in Spring Boot [Solved]

I was trying to run a HelloWorld program using Spring Boot when I got this error:

Exception in thread "main" java.lang.IllegalStateException: Could not evaluate condition on org.springframework.boot.autoconfigure.PropertyPlaceholderAutoConfiguration#propertySourcesPlaceholderConfigurer due to internal class not found. This can happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(

10 Examples to DateTimeFormatter in Java 8 to Parse, Format LocalDate and LocalTime

Parsing and formatting dates are other essential topics while working with date and time in Java. Even though the old Date API had the SimpleDateFormat and DateFormat class to support the formatting of date and parsing texts, they were not simple, or should I say there were just simple in writing the wrong code. You might know that SimpleDateFormat was not thread-safe and quite heavy to be used as a local variable. Thankfully, this has been sorted now with a new LocalDateTime class and DateTimeFormatter class, which has several inbuilt formats.

How to declare and Initialize two dimensional Array in Java with Example

An array of more than one dimension is known as a multi-dimensional array. Two of the most common examples of multi-dimensional arrays are two and three-dimensional arrays, known as 2D and 3D arrays, anything above is rare. I have never seen 4-dimensional arrays, even 3D arrays are not that common. Now the question comes when to use a multi-dimensional array? Any real-life example? Well, 2D arrays are very common on platform games like Super Mario Bros to represent screen or terrain; 2D arrays can also be used to represent structures like a spreadsheet, or to draw board games like Chess, which requires an 8x8 board, Checkers and  Tic-Tac-Toe, which requires 3 rows and 3 columns.

Top 10 Books Every Programmer Should Read

There is a saying that if you learn from your mistakes, you will only going to learn few things, but if you learn from other's mistakes, you can learn a lot of things in a short time, and what could be a better way to learn from someone's experience then reading books. Programming as a career is about constant learning and updating yourself, but unfortunately, there is no right way to begin. Schools and Colleges are far behind when it comes to real-world programming, and every Computer Science graduate is not lucky to work in a company that is great in training. The other viable option is to read books, join online courses, and follow advice from the great programmer and authors who are gone on that path, and learning from the book is the most tried and trusted way of all of them.

Top 5 FREE Personal Development and Leadership Courses in 2021 - Best of Lot

If you want to improve yourself and look for the best personal development courses, you have come to the right place. Earlier, I have shared the best coding courses for people with no programming experience, and today, I will share free online courses to improve myself. These personal development course lists include courses on improving your learning ability, negotiation skills, your health, and well-being, as well as on value education. These free online personal development courses are great to bring your best version out of you. 

How to use Spread operator and Rest parameter in JavaScript? Example Tutorial

Hello guys, if you are wondering what is Spread and Rest operator is in JavaScript are and how to use them in code then you have come to the right place. Earlier, I have shared some fundamental JavaScript concept tutorials like == vs === operator, hoisting, and destructuring, and in this JavaScirpt article, I am going to talk about Spread and Rest operators. JavaScript came out twenty-five years ago. Since then, it has changed a lot. First, it became the top programming language for client-side web development, and then with the emergence of Node.js, it also became the top player in server-side development. 

Top 5 Online Courses to Learn Artificial Intelligence (AI) with Python for Beginners in 2021 - Best of Lot

Hello guys, Artificial Intelligence is one of the growing fields in technology and many developers are trying to learn Artificial Intelligence to take their career next level. If you are a Python developer and looking for the best courses to learn Artificial Intelligence with Python then you have come to the right place. In this article, I will share the best courses to learn AI basics as well as some hands-on courses to practice AI with the Python library. I first come across AI when DeepMind beat Garry Kasparov, one of the finest players of Chess. It was way back in the 1990s, and AI has come a long way since then. Now, Google is using the same DeepMind to reduce the electric bills of its Data Center by 40%, and Elon Musk is talking about Self driving cars.

10 Examples of Collectors + Stream in Java 8 | Grouping By, Partition By, Joining, and Counting

As the name suggests, the Collectors class is used to collect elements of a Stream into Collection. It acts as a bridge between Stream and Collection, and you can use it to convert a Stream into different types of collections like List, Set, Map. Btw, it is not just limited to that, it even provides functionalities to join String, group by, partition by, and several other reduction operators to return a meaningful result. It's often used along with the collect() method of Stream class which accepts Collectors. In this article, you will learn how to effectively use in Java by following some hands-on examples.

What is Variable and Function Hoisting in JavaScript? Example Tutorial

Hoisting is a complex concept in JavaScript. Like other major programming languages, variables and functions are an important part of JavaScript. Being a dynamically typed programming language, the variable declaration does not require specifying variable types. JavaScript also supports functions. But there is a catch. When variables and functions are declared in JavaScript, a process called hoisting takes place, and if you don't know this important concept you may struggle reading and understanding code but don't worry. In this article, I will teach you what is hoisting in JavaScript and give you real-world examples of the function and variable hoisting to start with.  

Top 5 Unity 3D & Game Development Courses for Beginners in 2021 - Best of Lot

If you are learning Unity 3D in 2021 and looking for the best online course to learn Unity 3D and become a professional Game developer, then you have come to the right place. In the past, I have shared some free courses to learn the C# programming language and Game development basics using Unity 3D and other popular Game engines available on the market like Unreal Engine, Libgdx, and today, I am going to share the best Unity 3D and 2D courses from Udemy, Pluralsight, and Coursera to learn this valuable skill.

Top 5 Object Oriented Analysis and Design Interview Questions for Programmers, Software Engineers

Testing the design skill of a candidate is quite common in programming job interviews. Questions like, how do you design a vending machine or a traffic control system are very popular in object-oriented programming language interviews, like Java and C++. Designing a software System requires good experience and knowledge of tools of object-oriented design and analysis. You should not only be good at OOP fundamentals like Abstraction, Inheritance, Polymorphism, Encapsulation, Coupling, Cohesion, Association, Aggregation, or Composition but also on several crucial object-oriented design principles like SOLID Principles of Object-Oriented Design, which is the building block for writing flexible and maintainable code.

What is Destructuring in JavaScript? Example Tutorial

Arrays and objects play a very important role in programming. Every major programming language supports arrays and objects. Both arrays and objects are used to store data. The concept is simple but very powerful. JavaScript also supports arrays and objects. In fact, they are a very important part of modern JavaScript development. It does not matter if you are working on the frontend or backend, you are going to use arrays and objects. Over time, more and more features were added in JavaScript to make it easy to work with arrays and objects. 

Difference between first level and second level cache in Hibernate

The main difference between the first level and second level cache in Hibernate is that the first level is maintained at the Session level and accessible only to the Session, while the second level cache is maintained at the SessionFactory level and available to all Sessions. This means, you can use the first-level cache to store local data, i.e. the data which is needed by the Session, and you can use the second-level cache to store global data, i.e. something which can be shared across sessions. This is also one of the frequently asked Hibernate Interview questions and accessible in both telephonic rounds as well as on the face-to-face interviews, in both fresher and experienced level interviews.

Top 5 Tableau Desktop Specialist Associate Certification Courses and Practice Tests to Crack Exam in 2021 - Best of Lot

Hello guys, if you are preparing for Tableau Desktop Associate Certification or want to become a Tableau Desktop certified associate and looking for the best online courses to start your preparation, then you have come to the right place. In the past, I have shared the best courses to learn Tableau, and today I will share the best course to crack the Tableau Deskopt Certified Associate exam. These are the best online courses from sites like Udemy and Pluralsight and were created by experts and experienced Tableau developers. These will help you cover all exam topics and gain all the necessary skills required to pass this prestigious IT certification

Difference between IN, OUT, and INOUT parameters in JDBC Stored Procedure? Answer

Hello guys, Java Database Connectivity, the JDBC API supports three types of parameters, I mean, IN, OUT, and INOUT. They are used to bind values into SQL statements. An IN parameter is the one whose value is unknown when the SQL statement is created and you bind values using various setXXX() method depending upon the type of column those IN parameter refers in SQL query. For example in SQL query, SELECT * from EMPLOYEE where EMP_ID=? if the EMP_ID is a VARCHAR column then you must call the setString() method to pass the value to the IN parameter. 

Top 6 Free Courses to Learn Web Development in 2021 - Best of Lot

Hello guys, I have been sharing a lot of free online courses and books on various technology and programming language like Python, Java, C++, JavaScript, PHPReact, Angular, Spring in this blog for quite some time, and today I have brought some great free courses to learn the basics of web development. Web Development is an essential skill for programmers in this era of Startups. As a programmer or software developer, you should know how to create a website and create a mobile app of your own. Though it's not easy. Coding is like art, and many people are born with a coding sense; I mean, they love coding; they love to create stuff like websites, mobile apps, games, etc., and they love to automate things.

3 Ways to convert Date to LocalDate in Java 8 - Example, 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.