HTML

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]

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

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

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 java.util.stream.Collectors 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.

10 ways to Learn New Programming language or Tech skills in 2021?

One of the main challenges of being a programmer or software engineer is constant learning. Yes, that's true. As a programmer or developer, we always need to learn new things, sometimes every year. Thanks to C, Java, Linux, and SQL, we still have some ground, but the way these technologies are used changes every year. For example, we have a new JDK 14 release this year, even though many Java developers are still learning Java 8 and Java 11. We also have a Spring Framework release this year, combined with Spring Security 5.0 and Spring Boot 2.5.0 version, which many of us need to learn in 2021.

Top 5 Free Object-Oriented Programming Courses for Java Programmers in 2021 [UPDATED]

The OOP or Object Oriented Programming paradigm allows you to write a program by modeling real-world things in terms of class and object. It makes representing a real-world thing in the programming world smoother and will enable you to manage the complexity of your program. Even though several programming paradigms, like procedural and functional, most of the code we write today is object-oriented. Some of the most popular programming languages are object-oriented, like Java, Python, PHP, and JavaScript, all supported object-oriented programming.

10 Essential JVM Options for Java Applications [ Heap Memory, SSL, to Garbage Collection]

Hello guys, this is a brief guide of appropriate JVM options, which you will often see in production Java systems. As a Java developer, you should know what these JVM options mean, their importance, and how they affect your application. You will find that most of the JVM options are related to heap memory, garbage collection and to log some details, like heap dump, necessary for troubleshooting heap-related issues like a memory leak or excessive memory consumption. It's Ok if you don't know these Java virtual machine options yet, but you should be familiar with them, and that's the objective of this article. Btw, how do you find the JVM options your application is using? Well, you can see the startup scripts through which your application is started.

How to create a custom tag in JSP? Steps and Example

You can create a custom tag in JSP either by implementing the SimpleTag interface or extending SimpleTagSupport class. Custom tags are introduced in JSP 2.0 in an effort to minimize Java code from JSP to keep them maintainable and allow page authors to work more in HTML or XML, like environment than writing Java codes. SimpleTag and SimpleTagSupport allow you to create a custom tag in JSP. It's easier to start with SimpleTagSupport class because it implements all methods of the SimpleTagSupport interface and if you are writing a basic tag then you just need to override the doTag() method of this class. 

Static Class, Static Variable, Keyword, and Static Method Examples in Java - Tutorial

What is static in Java
Static in Java is related to class if a field is static means it belongs to the class, similarly static method belongs to classes and you can access both static method and field using the class name, for example,  if count field is static in Counter class than you can access it as Counter.count, of course, subject to restriction applied by access modifier like private fields are only accessible in class on which they are declared, protected fields are accessible to all classes in the same package but only accessible in subclass outside the package, you can further see private vs protected vs public for complete details on access modifier. 

Top 6 Free Maven and Jenkins Online Courses for Java Programmers in 2021 [ UPDATED]

Hello Java programmers,  if you want to learn Maven and Jenkins and look for free resources like free online courses, you have come to the right place. Earlier, I have shared the best Maven courses and best Jenkins courses, and in this article, I will share the best free Jenkins and Maven courses for Java programmers. If you have been doing professional Java development, you know that Maven and Jenkins are two of the most popular tools in the Java world. Maven helps organize your project and provide support to build and deploy Java projects, while Jenkins can provide continuous integration and delivery by completely automating build and deploy projects.

How to use lifecycle methods in functional components in React.js? useEffect() hook Example Tutorial

Hello guys, if you have been following my blogs then you know that I have launched a new series - React for Java developers and this is the 4th article on the series. Earlier, we have seen state management in React, Redux, and useState hooks example, and in this article, you will learn about how to use lifecycle methods in functional React components. Lifecycle methods are powerful features provided by React.js in the class-based components. Each of the lifecycle methods executes at a particular time during the lifecycle of a component. 

How to compare two Arrays in Java to check if they are equal - [String & Integer Array Example]

Hello guys, one of the common Programming, the day-to-date task is to compare two arrays in Java and see if they are equal to each other or not. Of course, you can't compare a String array to an int array, which means two arrays are said to be equal if they are of the same type, has the same length, contains the same elements, and in the same order. Now, you can write your own method for checking array equality or take advantage of Java's rich Collection API. Similar to what you have seen while printing array values in Java, java.util.Arrays class provides convenient methods for comparing array values.

5 Free Courses to Crack Google Cloud Professional Data Engineer Certification Exam in 2021 - Best of Lot

Hello guys, If you are preparing for Google Cloud Professional Cloud Data Engineer certification or simply known as GCP Data Engineer exam in 2021 and looking for free online Google cloud Engineer courses then you have come to the right place. In the past, I have shared the best courses to learn Google Cloud as well as the best online training courses to pass cloud engineer, cloud developer, and cloud architect certifications, and today, I am going to share free GCP Cloud Data Engineer certification courses for both beginners and experienced cloud professionals.

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 Redux Thunk in React.js? Example tutorial

Hello folks, This is the 3 part of my React for Java developer series and in the past two articles we have been focusing on statement management in React and we have seen that how to use manage state using Redux and useState hooks. And, in this article, we will learn about Redux Thunk, another useful concept when it comes to statement in React.js. State management is one of the most important concepts in react. If you are a react developer, then you must have used state in your project. There is no react project without a state. The state is defined as an instance of a component. It is an object that controls the behavior of a component. 

How to Convert or Print Array to String in Java? Example Tutorial

Array and String are very closely related, not just because String is a character array in most of the programming language but also with popularity - they are two of the most important data structure for programmers. Many times we need to convert an array to String or create an array from String, but unfortunately, there is no direct way of doing this in Java. Though you can convert an array to String by simply calling their toString() method, you will not get any meaningful value.  If you convert an Integer array to a String, you will get something like I@4fee225 due to the default implementation of the toString() method from the java.lang.Object class. Here, I show the type of the array and content after @ is hash code value in hexadecimal.

Top 5 Free Online Courses to learn JavaScript in 2021 - Best of Lot

Hello guys, If you want to learn JavaScript in 2021 by yourself and looking for some free resources like books, sites, and tutorials, then you have come to the right place. Earlier, I have shared the best JavaScript online courses to learn JavaScript in depth and In this article, I am going to share some of the best free JavaScript online courses you can join to learn JavaScript by yourself, on your own schedule, and at your own place. A lot of people are learning JavaScript, and the number is only increasing with each passing day, and why not? It's the #1 web development language. It got tons of useful frameworks and libraries like Angular, React Node.js, and jQuery, which makes web development really easy.

How to Format Date to String in Java 8 [Example Tutorial]

One of the common programming tasks in Java is to change the date format of a given Date or String. For example, you have something like "2017-01-18 20:10:00" and you want to convert it that date into "2017-01-18", or you want to convert from dd-MM-YY to MM-dd-YY or to any other format of your choice and need, but a valid date format as per Java specification. How will you do that? Well, it's not that difficult. It's just a two-step process. In the first step, you need to parse String to create an equivalent date using the current format, and then once you got the date, you need to again convert it back to String using the new format. The same process is repeated in both Java 8 and before, only corresponding API and class changes.

Top 15 Linux and UNIX Interview Questions and Answers for 1to 3 Years Experienced

UNIX and Linux Interview Questions and Answers
Hello guys, if you are preparing for technical interviews like Software developer or IT support and looking for some frequently asked Linux and UNIX interview questions then you have come to the right place. In the past, I have shared free Linux courses and today, I am going to share popular Linux and UNIX questions from technical interviews. You might already know that questions from various UNIX operating systems like Solaris, Linux, IBM AIX, or any other UNIX operating system are asked on different support and programming interviews and a good knowledge of essential UNIX concepts and commands goes a long way in cracking these interview as well as working efficiently in your day job. 

Top 30 JavaScript Interview Questions Answers for 1 to 3 Years Experienced

Building a career as a developer in the IT industry can be challenging if you lack stream-specific preparation. For instance, if you want to be a JavaScript developer, you have to dig deep into its concepts and learn every bit about JavaScript, but then also I would say, you are 50% prepared for the Job. I'm not saying that you aren't capable enough to get that JavaScript developer's Job, instead, I mean to say that you aren't ready enough to face the recruiters.

10 Best Coursera Courses to Learn Python, Data Science, and Cloud Computing in 2021 [UPDATED]

Hello folks, if you are looking for the best Coursera courses, certifications, and specialization to start your career in IT or make a career switch, then you have come to the right place. Coursera is one of the leading online portals and brings the best learning material, courses, and certifications from the worlds' top universities like the University of Michigan and top companies like Google, IBM, and Amazon. Learning on Coursera is a great way to learn in-demand tech skills and recognition and certification to showcase them to recruiters and companies looking to hire.  

What is Redux and how to use it? Example Tutorial

Managing state efficiently is very important in a react application. A React application depends on its state. React provides in-built support to manage the state but as the application grows, this in-built support becomes inefficient. So to manage the state of a large and complex react application, we have to use third-party state management libraries. Redux is by far the most popular state management library. It is heavily used with react and if you are planning to work in a real-time react project, you will encounter redux.

How to Convert a List to Map in Java 8 - Example Tutorial

One of the common tasks in Java programming is to convert a list to a map and I have written about this in the past and today we'll see how Java 8 makes this task easier. Btw, be it Java 7 or Java 8, you need to keep something in mind while converting a list to a map because they are two different data structures and have completely different properties. For example, the List interface in Java allows duplicate elements but keys in a Map must be unique, the value can be duplicated but a duplicate key may cause a problem in Java 8. This means a List with duplicates cannot be directly converted into Map without handling the duplicate values properly. 

4 Books to learn Java Programming from Scratch in 2021 - Best of lot

I receive half a dozen emails every day asking about which is the best to learn Java from scratch? Which book should I read in 2021 to learn Java? Or Which is the best Java for beginners? When I receive such an email, before giving my recommendation, I ask two questions, first do you have any programming experience? like, Are you coming from C, C++, or Python background? Or you are a fresher with no experience in programming, just a couple of classes on data structure and algorithm and operating systems in college.

Can you Overload or Override main method in Java? Example

One of the common doubts among Java beginners while learning the overloading and overriding concept is, whether it's possible to overload the main in Java? Can you override the main method in Java? How will JVM find if you change the signature of the main method as part of the method overloading? etc. These are good questions and show the curiosity and application of knowledge of students, so if you are the tutor you must answer these questions. If you don't know the answer to this question, don't worry, just read this article till the end and you will find the answer yourself.  I have tried to explain in simple words but if you still can't get it, feel free to comment and I will try to help you personally. 

Top 5 Free Courses to Learn React Native Courses for Beginners in 2021 - Best of Lot

Hello guys, if you are learning React Native to make cross-platform apps and looking for some free courses to learn React Native then you have come to the right place. In the past, I have shared the free courses to learn ReactJS, and the best React Native courses, and today I am going to share the best free online training courses to learn React Native. The list includes both React Native crash courses as well as comprehensive courses to learn React Native in depth. There is a huge demand for cross-platform app frameworks like React Native and Flutter which allows you to create native-looking iOS and Android apps with the same code base.

Top 5 Free Angular Courses for Beginners to Learn Online in 2021 - Best of Lot

Google's Angular is one of the most popular JavaScript frameworks for creating web apps. It helps you in creating complex web applications in less time. It's maintained by Google, so you can also rest assured that this powerhouse of a framework is built with speed and purpose and here for the long run. The Angular Framework is also the most popular framework in the world for developing single-page applications.  The framework was first launched as Angular JS, which allowed building a web application using the Model View Controller concept, and it was hugely popular, but it was later re-written completely, which is now known as simply Angular or Angular 2.

How to use Map.compute(), computeIfPresent() and ComputerIfAbsent in Java? 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.

What is Method Overloading, Overriding, Hiding, Shadowing and Obscuring in Java and Object-Oriented Programming?

Hello guys, today, I am going to explain a couple of fundamental object-oriented programming concepts in Java, like Overloading, Overriding, Hiding, Shadowing, and Obscuring. The first two are used in the context of a method in Java while the last three are used in the context of variables in Java. Two methods with the same name and same class but the different signature is known as overloading and the method is known as an overloaded method while a method with the same name and same signature but in parent and child class is known as overriding. On the other hand,  Hiding is related to overriding since the static and private method cannot be overridden, if you declare such methods with the same name and signature in parent and child class then the method in the child class will hide the method in the parent class.

Top 6 HTML 5 and CSS 3 Online Courses for Beginners to Learn in 2021 [UPDATED] - Best of Lot

Hello guys, if you want to learn HTML and CSS to become a web designer and developer and are looking for the best HTML and CSS courses, you have come to the right place. In the past, I have shared the best free courses to learn HTML and CSS, and in this article, you have a selection of the best courses you can have to learn a lot about HTML5 and CSS3 online.  This article will share the best HTML5 and CSS 3 online courses from sites like Udemy, Coursera, Pluralsight, and edX for beginners and experienced developers. These online training courses and classes are created by experts and trusted by thousands of developers to learn HTML5 and CSS3 online in 2021

When to use PUT or POST in a RESTful 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.
 

How to sort HashMap by values in Java 8 [using Lambdas and Stream] - Example Tutorial

In the past, I have shown you how to sort a HashMap by values in Java, but that was using traditional techniques of the pre-Java 8 world. Now the time has changed and Java has evolved into a programming language that can also do functional programming. How can you, a Java Programmer take advantage of that fact to do your day-to-day task better like how do you sort a Map by values in Java using lambda expressions and Stream API. That's what you are going to learn in this article. It will serve two purposes, first, it will tell you a new way to sort a Map by values in Java, and, second and more important it will introduce you to essential Java 8 features like Lambda Expression and Streams, which every Java Programmer should learn.

5 Essential Spring Boot Annotations with Examples - Tutorial

Annotations have completely changed the way you write Java code. It's now impossible to write any Java code without using annotations but that's for good. They provide a lot of value and that's why it's important for a Java developer to get familiar with essential annotations of the framework he or she is using. When I think about Java, some of the essential annotations which come to our mind are @Override, @SuppressWarning, and @Deprecated. Similarly, if you are using the Spring Boot framework, an extension of the Spring framework which aims to simplify the Java development with Spring, you will often end up using a couple of annotations like @SpringBootApplication or @EnableAutoConfiguration.

Top 5 Free Jenkins, Docker, DevOps, Maven, and Kubernetes Courses for Java Programmers in 2021 [UPDATED]

Hello guys, you might have heard about DevOps and all the attention it is getting now. DevOps is a new phenomenon, and there is a mad race among senior developers to become a DevOps engineer. Well, I am not one of them as my passion is for becoming a software architect, but I have indeed spent some time learning DevOps just to increase my knowledge of the field as I strongly believe in the phrase, jack of all and master of one :-). In the DevOps world, tools matter a lot, and the whole of the DevOps phenomenon to create an automated pipeline for delivering quality software heavily relies on clever uses of tools like Maven, Jenkins, Docker, Kubernetes, and others.

Top 5 Golang Courses to Learn Go Programming Language in 2021 [UPDATED] - Best of Lot

Hello guys, if you want to learn the Go programming language in 2021 and look for the best Golang online courses then you have come to the right place. Earlier, I have shared the best JavaScript Courses, and today, I am going to share about one of the modern programming languages called Go or Golang. This popular, next-generation, highly efficient programming language is created by none other than Google, creator of Angular, Android, Flutter, and Dart to make their software development process smoother and better. 

Top 20 Essential Java Interview Questions with Answers for Freshers with 1 to 2 years Experienced

If you are a grad looking for an internship position in a company that uses Java, or a fresher, just out from college and looking out for a Java development position, then this post is for you. I have attended, taken, and participated in different levels of Java interviews. I can say there is a vast difference between them, which is not surprising because you obviously want to ask different level questions based upon whether the candidate is fresher or experienced. Similarly, the problem at phone interviews, written tests, and face-to-face interviews, keeping this in mind, and give you always have a limited amount of time before going for an interview, It's essential to prepare the right set of questions.

10 Advanced Programming and Development Books for Experienced Developers - Best of Lot

Hello guys, if you are looking for some advanced programming and development books to take your coding and software development skill to next level then you have come to the right place. Earlier, I have shared advanced courses in Java, Python, C++, and JavaScript and in this article, I am going to share some good books for the experienced programmer which can help them to become an expert. Learning never stops but once you become a professional programmer and spent a couple of years doing professional programming, you need to make some effort to reach the next level i.e. to become an expert programmer. Continuously doing the same stuff and not analyzing will not make you better. This is where these books can help you.

The Ultimate Guide of Lambda Expression of Java 8 - Example Tutorial

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.

Top 5 Online Courses to Learn Spring Boot in 2021 [UPDATED] - Best of Lot

Hello guys, if one of your goals is to learn Spring Boot in 2021, and I have started working towards it. As I have talked about my 3 point action plan to learn new technology, the first step is to attend some online courses and start building from that. If you are not sure what is Spring Boot and why should you learn Spring Boot, then let me tell you that it should be the first Java framework you should learn in 2021. The Spring Boot makes it really easy to work with the Spring framework by removing all the starting hurdles concerning setup and configuration. In one word, it makes it possible to write a Spring-based Java application and run them like core Java applications, like from the primary method.

4 Examples of Stream.collect() method in Java 8

Hello guys, you may know that Java 8 brought Stream API which supports a lot of functional programming operations like filtermapflatMap, reduce, and collect. In this article, you will learn about the collect() method. The collect() method of Stream class can be used to accumulate elements of any Stream into a Collection. In Java 8, you will often write code that converts a Collection like a List or Set to Stream and then applies some logic using functional programming methods like the filter, map, flatMap and then converts the result back to the Collection like a ListSetMap, or ConcurrentMap in Java.

Difference between List and ArrayList Reference Variables in Java? Example Tutorial

Someone who is just starting with Java programming language often has doubts about how we are storing an ArrayList object in List variable, what is the difference between List and ArrayList? Or why not just save the ArrayList object in the ArrayList variable just like we do for String, int, and other data types. Well, the main difference between List and ArrayList is that List is an interface while ArrayList is a class. Most importantly, it implements the List interface, which also means that ArrayList is a subtype of the List interface. In Java or any object-oriented language, the supertype of a variable can store an object of subtype.

How to Increasing Heap Size of Java application in JVM? Example Tutorial

Hello guys, if you are wondering how to change the heap size of the heap space of your Java application then you have come to the right place. In this article, I am going to tell you how to increase Java heap space so that your JVM will not crash using OutOfmemoryError. We have already seen how to increase heap memory in Maven and ANT and now we will learn how to increase heap size in Java, Eclipse, Tomcat, and WebSphere Server in a series of articles. Since all these are Java applications, once you know how to change heap space in Java, you can do that in any Java application, provided you know the right place, which is what we will see in this article.

5 Free Courses to Crack GCP Professional Cloud DevOps Engineer Exam in 2021 - Best of Lot

If you are preparing for Google Cloud Professional DevOps Engineer certification  in 2021 and looking for free online Google cloud DevOps Engineer courses then you have come to the right place. In the past, I have shared the best Google Cloud courses and best DevOps Courses,  as well as the best online training courses to pass cloud engineer, data engineer, and cloud architect certifications, but my readers kept asking for free online courses on Google Cloud, particularly for DevOps engineer certification, and today, I am going to share free GCP Cloud DevOps Engineer certification courses for both beginners and experienced cloud professionals.

The Ultimate Guide of Remote Debugging in Java using Eclipse IDE? Example Tutorial

The remote debugging of the Java program is an ultimate tool in the arsenal of a Java developer, which is often becoming the last and only tool to investigate a bug on a Java application running on the remote host like on a Linux server or Windows server. Almost all major Java IDE provides remote debugging like NetBeans, Eclipse, and IntelliJ IDEA, but I mostly use Eclipse for Java coding and so it's my preferred tool to remote debug a Java program. In order to set up remote debugging in Eclipse, you need to do a couple of tasks like you need to start your JVM with debugging parameters or arguments and then you need to create a "remote debug configuration" in Eclipse IDE itself.

How to Convert java.util.Date to LocalDate in Java 8 - Example Tutorial

Hello guys, once you move to Java 8, you will often find yourself working between old and new Date and Time API, as not all the libraries and systems you interact with will be using Java 8. One of the common tasks which arise from this situation is converting old Date to new LocalDate and that's what you will learn in this tutorial. There seems to be a couple of ways to convert a java.util.Date to java.time.LocalDate in Java 8, but which one is the best way? We'll figure it out in this article, but first, let's explore these different ways to convert a java.util.Date object to LocalDate in Java 8 code.

How to Convert Stream to List, Set, or Collection in Java 8 - Example Tutorial

Hello guys, if you are following Java releases then you know that introduction of the Stream class is one f the most important addition in Java 8 as it makes processing bulk data really easy. Since data is the core part of any application and probably is the most important thing now than ever, a good knowledge of how to use Stream class effectively is important like how to work between Collections and Stream classes. If you have worked with Stream then you would have noticed that even though we can easily create a stream from a List and Set by using the stream() method added on java.uti.Collection interface, unfortunately, Stream class doesn't have a method to convert a Stream back to List or Set or any other data structure in Java.

Top 5 Books to learn SQL and Database design in 2021 - Best of Lot

SQL (Structured Query Language) is one of the most essential skills of a programmer. I would rate this skill similar to UNIX if you are a professional programmer because it doesn't matter whether you are Java, C++, or a .NET developer, you are bound to write SQL queries. Since a database is an integral part of any modern Java or Web application, the Interviewer always preferred candidates with excellent SQL skills. Now, the big question comes, how a programmer can learn SQL? Does just knowing how to query a table is enough? If you remember, insert, update, delete, and select, then are you a competent SQL programmer?

Can you take training after passing OCMJEA 6 Exam (1Z0-897), Assignment(1Z0-865) and Essay (1Z0-866)?

Yes, you can take the training after passing the OCMJEA exam. Even though the training is a must to obtain the certification, You do not have to complete it before you give an exam. It is just listed as the first step to prepare well for your exam. If you have decent experience in core Java and enterprise Java, you can always complete the training when you are comfortable about it, but you must complete it to become an Oracle Certified Java Architect. In the last step of the exam, you need to submit a form containing the training detail to obtain credits for training.

How to parse String to LocalDate in Java 8 - DateTimeFormatter Example

From Java 8 onward, you are no longer dependent on the buggy and bulky SimpleDateFormat class to parse and format date Strings into real Date objects in Java e.g. java.util.Date. You can use the DateTimeFormatter class from java.time package for all your formatting and parsing need. You are also no longer required to use another buggy class java.util.Date if you are doing fresh development, but if you have to support legacy code then you can also easily convert LocalDate and LocalTime to java.util.Date or java.sql.Date. In this tutorial, we will learn about both parsing String to date in Java and formatting Date into String.

What is @Conditional annotations in Spring Framework? Example Tutorial

Hello guys, if you want to know what is @Conditional annotation in Spring Framework and how to use it then you have come to the right place. Earlier, I have shared free courses to learn Spring Framework and Spring Boot, and in this article, you'll learn what they are, how to use them with some beautiful 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. 

Top 10 Books Java Developers Can Read in 2021

Hello guys, If you are a Java developer and wondering what to read in 2021, then you have come to the right place. In this article, I will share 10 books on Java, Spring, and related technology a Java developer can read. I have included books for both experienced Java developer who is more inclined to learn about architecture stuff,  developing for Cloud, MicroService, Java 9 to Java 16 features, and Spring 5 features and thinking of learning Kotlin to improve their productivity. Still, I have not forgotten junior and less experienced Java developers or some thinking of starting their journey into the Java world in 2021.

Java 8 Stream filter() + findFirst Example Tutorial

Suppose, you have a list of prime numbers and you need to find the first prime number which is greater than a given number? How do you find it? Don't tell that you will loop through the list and check each element and return the first element which is greater than the given number. Well, that's right but that's not what you should do in Java 8. That's good for Java 7 or earlier version but Java 8 offers you many better alternatives and one of them is Stream. You can use the Stream class along with filter() and findFirst() methods to find out an element based upon a Predicate, a functional interface for defining a condition which returns a boolean.

Top 22 Array Concepts Interview Questions Answers in Java

An array is one of the fundamental data structures and most of the other advanced data structures like lists, hash tables are built using arrays.  Good knowledge of fundamental data structures like the array, linked list, a binary tree is not just essential for writing better code but also doing well on Programming Job interviews. Array-based questions are quite popular in Java interviews. There are two types of questions you will find, first which are based upon array implementation in Java, and second which are based upon how to use an array data structure to solve some coding problems. The first type of question is quite popular in the telephonic round of Java interviews and the second is usually asked on written tests and face-to-face interviews.

How to add and remove Elements from an Dynamic Array in Java? Example Tutorial

Java beginners often ask how to add new elements to an array in Java? or how to remove elements from an array in Java? is that possible in Java? Well, no, it's not possible in Java because arrays length cannot be changed once created. This means neither you can add new elements nor you can remove an old one from an array in Java. All you can do is reassign values to a different bucket. For example, if you have a string array of length 3 like {"java", "is", "great"} then you can just replace the individual index to make it like {"Python", "is", "great"} by replacing "java" with "Python" at first index, but you cannot add or remove elements.

Top 5 Spring Cloud Annotations in Java with Examples

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.

Difference between array and Hashtable or HashMap in Java

A couple of days back someone asked me about the difference between an array and a hashtable, though this is a generic data structure and programming question, I'll answer it from both a general programming perspective as well on Java perspective where Hashtable is not just a data structure but also a class from Java Collection API. Even though both array and hashtable data structure are intended for fast search i.e. constant time search operation also known as O(1) search, the fundamental difference between them is that array require an index while hash table requires a key which could be another object. 

Top 5 Free MongoDB and NoSQL courses for Beginners to Learn in 2021 - Best of Lot

If you want to learn MongoDB in 2021, one of the most popular NoSQL databases,s and are looking for free resources like free tutorials and free online MongoDB courses to start with, you have come to the right place. Earlier, I have shared the 10 free full-stack development courses, and today, I will share the 5 best free online courses to learn Mongo DB online. These courses are created by experts and made free for educational purposes. Thousands of students have already joined these free Mongo DB courses, and you can also do the same to learn this in-demand skill and further boost your resume for cutting-edge jobs. 

3 Ways to convert a Map to List in Java 8 - Example Tutorial

Hello guys, when you convert a Map to List in Java 8 or before, you have three choices like you can get a list of keys from Map, a List of values from Map, or a List of entries from Map, which encapsulates both keys and values. The API doesn't provide these methods because Map doesn't guarantee any order and the List interface guarantees ordering, like insertion order. Hence, JDK API provides an equivalent method to convert a Map to Set, like keySet() will return a set of keys and entrySet() will return a set of entries.

How to Remove Objects From ArrayList while Iterating in Java - Example Tutorial

One of the common problems many Java Programmers face is to remove elements while iterating over ArrayList in Java because the intuitive solution doesn't work like you just cannot go through an ArrayList using a for loop and remove an element depending upon some condition. Even though java.util.ArrayList provides the remove() methods, like remove (int index) and remove (Object element), you cannot use them to remove items while iterating over ArrayList in Java because they will throw ConcurrentModificationException if called during iteration. The right way to remove objects from ArrayList while iterating over it is by using the Iterator's remove() method.

Top 5 Linux Courses from Udemy, Coursera, and Pluralsight for Beginners in 2021 [UPDATED] - Best of Lot

Hello guys, if you want to learn Linux operating systems and command lines and look for the best Linux courses, you have come to the right place. In the past, I have shared some free Linux courses and bash scripting courses for programmers and developers, and many of you asked for more comprehensive online Linux courses to learn Linux in-depth, which motivates me to write this article. In this article, you will find the best Linux online training courses from Udemy, Pluralsight, Coursera, and edX, my favorite online learning platforms. 

9 JSP Implicit Objects and When to Use Them

If you are new to JSP then your first question would be what are implicit objects in JSP? Well, implicit objects in JSP are Java object which is created by Servlet containers like the tomcat or Jetty during translation phase of JSP, when JSP is converted to Servlet. These objects are created as local variables inside the service() method generated by the container. The most important thing about the implicit objects is to remember that these objects are available to any JSP developer inside the JSP page and they can do a lot of things with implicit objects and expression language which was only possible with scriptlet earlier. That's why they are known as implicit objects. 

How to implement PreOrder traversal of Binary Tree in Java - Example Tutorial

The easiest way to implement the preOrder traversal of a binary tree in Java is by using recursion. The recursive solution is hardly 3 to 4 lines of code and exactly mimic the steps, but before that, let's revise some basics about a binary tree and preorder traversal. Unlike array and linked list which have just one way to traverse, I mean linearly, the binary tree has several ways to traverse all nodes because of its hierarchical nature like level order, preorder, postorder, and in order. Tree traversal algorithms are mainly divided into two categories, the depth-first algorithms, and breadth-first algorithms. In depth-first, you go deeper into a tree before visiting the sibling node, for example, you go deep following the left node before you come back and traverse the right node.

Is Java a Pure Object Oriented Programming Language?

Hello guys, today, I am going to discuss one of the oldest questions related to Java, whether Java is a pure object-oriented language or not? The short answer is no. My answer is based on the fact that in a pure object-oriented language everything is an object and there are many things in Java that are not objects like primitive data types like boolean, char, short, int, long, float, double, different kinds of arithmetic, logical and bitwise operator like +, -. *, /, &&, || etc. There are only a few pure OO programming languages are Smalltalk and Eiffel, If there is more, I may not know but Smalltalk is often touted as the purest form of an object-oriented language.

How to reverse a singly linked list in Java without recursion? Iterative Solution Example

Hello guys, reverse a linked list is a common coding problem from Programming Job interviews and I am sure you have seen this in your career, if you are not, maybe you are a fresher and you will going to find about this very soon in your next technical interview. In the last article, I have shown you how to use recursion to reverse a linked list, and today, I'll show you how to reverse a singly linked list in Java without recursion. A singly linked list, also known as just linked list is a collection of nodes that can only be traversed in one direction like in the forward direction from head to tail. Each node in the linked list contains two things, data and a pointer to the next node in the list.

10 Best Free Data Structure and Algorithms Courses in Java and C++ 2021 [UPDATED]

Algorithms and Data Structure are two of the most fundamentals and essential topics from Computer Science, which is used everywhere in software development. I firmly believe that a good knowledge of these two topics is also crucial to become a better programmer because a person who has a good understanding of algorithms and data structures can make thoughtful choices and write programs that can handle changes better and perform well. They are also essential to crack coding interviews at top tech companies like Google, Microsoft, Amazon, Facebook, and Apple, which puts a lot of emphasis on candidate's ability to use existing data structures and algorithms to solve complex problems they have never seen before.

How to find 2nd, 3rd or kth element from end in a singly linked list in Java [Solved] - Example

Hello guys, today, I am going to discuss one of the important linked list based coding problems from interviews - how to find the Kth element from the end? This question is also asked as to how do you find the 3rd element from the last of a singly linked list in one pass or write a Java program to find the 5th element from the tail of a given linked list in one iteration. In this article, you will learn the programming technique so that you can solve any variant of this problem, I mean the Kth node from the tail problems and some linked list-based challenges. The difficulty in this question is that you need to solve the problem in one iteration or one pass. This means you cannot traverse the linked list again. I mean you cannot go till the end then traverse back to the Kth element.

6 Advanced Comparator and Comparable Examples in Java 8 for Sorting ArrayList Objects By Fields

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.

Top 5 Courses to learn MERN Stack in 2021 - (MongoDB, Express.js, React.js, and Node.js)

The popularity of the MERN stack development has grown significantly in recent years. The MERN stack is one of the two popular JavaScript stacks, along with the MEAN stack, and used to develop single-page dynamic web applications.

MERN stands for MongoDB, Express.js, React.js, and Node.js.
  • MongoDB: A popular NoSQL database. It stores data in JSON format.
  • Express.js: A flexible and minimal web framework for Node.js.
  • React.js: A JavaScript library used to create user interfaces.
  • Node.js: A runtime environment used to execute JavaScript outside the browser.

How to use Randam vs ThreadLocalRandom vs SecureRandom in Java? Example Tutorial

Hello guys, one of the common tasks for Java developers is to generate an array of random numbers, particularly in game development. For example, if you are coding for dice-based games like Ludo or Snake and Lader then you need to generate a random number from 1 to 6 to simulate dice behavior. The same goes for other dice-based games. There are many cases where you need to generate random numbers and an array of random numbers. In some cases, duplicates may be allowed while other duplicates are not permitted.  

How to implement Linear Search Algorithm in Java? Example tutorial

In the last article about searching and sorting, you have learned the binary search algorithm and today I'll teach you another fundamental searching algorithm called Linear search. Linear search is nothing but iterating over the array and comparing each element with the target element to see if they are equal since we search the array sequential from start to end, this is also known as sequential search or linear search. It is very slow as compared to binary search because you have to compare each element with every other element and is definitely not suitable for a large array. It's practically useful only in the case of a small array of up to 10 to 15 numbers. In the worst case, you need to check all elements to confirm if the target element exists in an array or not.

How to Convert String to LocalDateTime in Java 8 - Example Tutorial

Hello guys, today, I will talk about a common problem while working in a Java application, yes you guessed it right, I am talking about String to Date conversion in Java. I had discussed this before (see the Date to String) when Java 8 was not out, but with Java 8, I don't see any reason to use old date and time API, and hence I am writing this post to teach you how to convert String to Date in Java 8 or beyond. Suppose you have a date-time String "2016-03-04: 11:01:20" and you want to convert this into a LocalDateTime object of Java 8 new date and time API, how do you do that? Well, if you have worked previously with String and Date then you know that you can parse String to Date in Java.

How to use Stream.filter method in Java 8? Example Tutorial

In the last couple of Java 8 tutorials, you have learned how to use map(), flatMap(), and other stream methods to get an understanding of how Java 8 Stream and Lambda expressions make it easy to perform the bulk data operation on Collection classes like List or Set. In this Java 8 tutorial, I am going to share how to use the filter() method in Java 8, another key method of the Stream class.  This is the one method you will always be used because it forms the key part of the Stream pipeline. If you have seen some Java 8 code, you would have already seen this method a couple of times.