How to return different HTTP status code from a Spring MVC controller? Example Tutorial

Hello guys, if you are wondering how to return different HTTP Status codes from a Spring MVC controller then you have come to the right place. You can use @ResponseCode annotation on Spring MVC to send different HTTP codes to the client as part of the HTTP response. If you are developing REST APIs then you can even @RestControler to do that job. This article will demonstrate how to return different HTTP statuses for a Spring MVC controller. Prior to implementation, all we need to understand what is with the HTTP return types and why we need them. Let's have a quick look into this.

5 Differences between COALESCE and ISNULL in SQL Server - Example Tutorial

Even though both ISNULL and COALESCE is used to provide default values for NULLs there are some key differences between them like ISNULL() is a T-SQL or Microsoft SQL Server-specific function or operator, and datatype and length of the result depends upon a parameter, but COALESCE is a SQL ANSI standard, it can accept more than one parameter and unlike ISNULL, the result doesn't directly depend upon a parameter, it is always the type and length of the value returned. Also, what is the difference between COALESCE and ISNULL is one of the frequently asked Microsoft SQL Server interview questions, and knowing these differences can help in both your day-to-day SQL development works and during job interviews.

Difference between map() and flatMap() in Java 8 Stream - Example

The map() and flatmap() are two important operations in the new functional Java 8. Both represent functional operation and they are also methods in java.util.stream.Stream class but the map is used for transformation and flatmap is used for both transformation and flattening, that's why it's called the flatmap. The key difference between map() and flatmap() function is that when you use a map(), it applies a function on each element of the stream and stores the value returned by the function into a new Stream. This way one stream is transformed into another like a Stream of String is transformed into a Stream of Integer where each element is the length of the corresponding Stream.

Top 5 Courses to Crack AWS Solutions Architect - Associate Exam (SAA-C01 and C02) in 2021 - Best of Lot

Hello guys, are you preparing for AWS Solutions Architect - Associate Exam?  or Do you want to become Amazon Web Services (AWS) Certified Developer to give your Cloud Computing career a push? and looking for some useful resources to prepare well for your exam then you have come to the right place. In the past, I have shared some free courses to learn AWS for beginner and in this article, I will share some of the best online courses to pass the AWS Solutions Architect - Associate Exam and become Amazon Web Services Certified Associate - a certification which will not only add value into your resume but also help you to get the high-paying job you always wanted.

How to use props in React? Example Tutorial

If you have ever worked with React, you definitely know what components are. A react application is made of several components and that is why components in React are defined as the building blocks of the application. In simple terms, a component is a class or function that can accept input and return a piece of code that defines a UI. Every React component can have input. These inputs are known as props. Props stand for properties and they are optional. A component works fine without props but they are one of the most useful parts of React.

3 Best Spring Security Online Training Courses for Java Developers in 2021 [UPDATED]

Spring Security is one of the leading open-source, security frameworks that allow you to implement security in Java-based web applications. It provides several security features like authentication, authorization, remember me out-of-the-box, which means you can directly use them without adding code or changing your class. Yes, Spring Security implements security at the application level i.e. you can even secure your non-secure resource without modifying them. It is also the leading framework to secure RESTful Web Services. Because of all these, the demand for Java developers with good knowledge of Spring Security is very high.

10 Example of Lambda Expressions and Streams in Java 8

Java 8 release is just a couple of weeks away, scheduled on 18th March 2014, and there is a lot of buzz and excitement about this path-breaking release in the Java community. One feature, which is synonymous with this release is lambda expressions, which will provide the ability to pass behaviors to methods. Prior to Java 8, if you want to pass behavior to a method, then your only option was the Anonymous class, which will take 6 lines of code, and the most important line, which defines the behavior is lost in between. Lambda expression replaces anonymous classes and removes all boilerplate, enabling you to write code in a functional style, which is sometimes more readable and expression.

Top 30 React.js Interview Questions Answers for 1 to 2 Years Experienced

Hello guys, if you are preparing for React developer interviews and looking for frequently asked React.js interview questions then you have come to the right place. Earlier, I have shared the best courses, books, and websites to learn React.js and in this article, I am going to share 35 frequently asked React.js interview questions, suitable for 1 to 2 years experience developers. ReactJS is one of the most recently built open-source front-end programming languages. It came directly from Facebook's headquarter back in 2011. Earlier Recat.js was only limited to Facebook but now, it is one of the most extensively used programming languages all across the world.

What is volatile modifier or volatile field in Java? Example

The volatile modifier has always been an interesting and tricky topic for many Java programmers. I still feel that it's one of the most underutilized modifiers in Java, which can do a lot of good if understood and applied correctly, after all, it provides a lock-free way to achieve synchronization in Java. If a field is shared between multiple threads and one of them changes its value i.e. one thread reads from the field which is written by other threads, then, by using a volatile modifier, you can synchronize access to this field. The volatile modifier in Java provides visibility and ordering guarantees without any locking.

Top 6 Courses to Learn Jenkins for CI/CD for Java Developers in 2021 - Best of Lot

In today's world of Agile and DevOps, Jenkins has become an indispensable tool for both Java programmers and DevOps engineers. Jenkins allows you to set up continuous integration (CI) and continuous deployment (CD) pipeline, which reduces risk on Software development and delivery. This means hassle-free development and deployment. It also means quicker feedback because as soon as a commit has been made into a source control system like Git, Jenkins can start building artifacts and running unit tests. You will instantly receive an email if the build fails due to an issue or a unit test doesn't pass. This quick feedback loop ensures that your codebase remains error-free.

5 Difference between Constructor and Static Factory method Pattern in Java

The common way to create objects in Java is by using public constructors. A class provides a public constructor like java.lang.String so anyone can create an instance of String class to use in their application, but, there is another technique that can be used to create objects in Java and every experienced Java programmer should know about it. A class can provide a public static factory method that can return an instance of the class e.g. HashMap.newInstance(). The factory method is a smart way to create objects in Java and provides several advantages over the traditional approach of creating objects using constructors in Java. It can also improve the quality of code by making the code more readable, less coupled, and improves performance by caching.

How to set Java Path and Classpath in Windows 7, 8 and Windows 10 - Tutorial

So, you just bought a new PC or Laptop with Windows 8 operating system, and wondering how to set PATH and Classpath on Windows 8; Or, you might have just upgraded your Windows 7 laptop to the professional edition of Windows 8 and looking to set JDK Path to compile Java programs. Not to worry, this is the second step for anyone who wants to learn Java programming. Of course, the first step is to install JDK.  In this Java tutorial, we will see step by step guide to set Java PATH and CLASSPATH in the Windows 8 operating system. By the way, if you are learning Java in Windows 10 operating system, You should still be able to set the Java path and classpath in Windows 10 by following the steps given here, because navigation steps for modifying environment variables on Windows 10 and Windows 8 are almost same.

Difference between @WebMvcTest and @DataJpaTest in Spring Boot? Example

Hello guys, testing the Spring Boot application is very important but not many developers pay attention to that. If you are learning how to test the Spring Boot application and wondering what is @WebMvcTest and @DataJpaTest and how to use them then you have come to the right place. Earlier, I have shared 20+ Spring Boot Testing interview questions and in this article, I will teach you how to use @DataJpaTest and @WebMvcTest annotation with real-world examples.  Spring Boot is an evolution of the Spring framework which helps to create both stand-alone and spring-based applications with minimal cost. 

Top 6 Online Courses to learn Gatsby.js Framework in 2021 - Best of Lot

Hello guys, if you want to learn Gatsby and looking for the best online courses to learn Gatsby, then you have come to the right place. In the past, I have shared the best React courses, and today, I will share the best Gatsby online courses for beginners. The Gatsby.js has become significantly popular in recent years. It is a react-based static site generator powered by GraphQL and is quite popular to develop static websites that don't require a traditional backend. Instead, these site uses APIs and CDN to deliver content to browser and mobile applications. 

How to remove all special characters from String in Java? Example Tutorial

You can use a regular expression and replaceAll() method of java.lang.String class to remove all special characters from String. A special character is nothing but characters like - ! #, %, etc. Precisely, you need to define what is a special character for you. Once you define that you can use a regular expression to replace those characters with empty String, which is equivalent to removing all special characters from String. For example, suppose, your String contains some special characters e.g. "Awesome!!!" and you want to remove those !!! to reduce some excitement, you can use replaceAll("!", "") to get rid of all exclamation marks from String.

Difference between Comparison (QuickSort) and Non-Comparison (Counting Sort) based Sorting Algorithms? Example

For many of you, this might be a surprise that how you can sort or arrange items without comparing them with each other, but it's possible. There are some sorting algorithms that perform sorting without comparing the elements rather than making certain assumptions about the data they are going to sort. The process is known as non-comparison sorting and algorithms are known as the non-comparison-based sorting algorithms. Non-comparison sorting algorithms include Counting sort which sorts using key-value, Radix sort, which examines individual bits of keys, and Bucket Sort which examines bits of keys. These are also known as Liner sorting algorithms because they sort in O(n) time. They make certain assumptions about data hence they don't need to go through a comparison decision tree.

Why Static Code Analysis is Important? Pros and Cons

In the last few years, Software code quality and security have gone from being a “nice to have” to a necessity, and many organizations, including investment banks, are making it mandatory to pass static code analysis tests, penetration testing, and security testing before you deploy your code in production. Static analysis tools like findbugs and fortify are getting popular every passing day and more and more companies are making fortify scan mandatory for all new development.  For those unaware of what static code analysis is, static code analysis is about analyzing your source code without executing them to find potential vulnerabilities, bugs, and security threats.

Single Responsibility Principle Example - SRP of SOLID Design Principle Tutorial

Hello guys, if you want to learn about SRP or the Single Responsibility principle and wondering how to write code that follows SRP and what are pros and cons of following this design principle then you have come to the right place. Earlier, I have shared the best object-oriented programming and design courses and books and in this article, I am going to talk about SPR. The Single Responsibility Principles, popularly known as SRP is part of 5 Object-oriented design principles, introduced by Robert C. Martin, popularly known as Uncle Bob. The Single Responsibility principle says that "there should be one reason to change a class". This means a class should do only one thing, and do it perfectly.

Top 5 Courses to Crack Certified Kubernetes Application Developer (CKAD) Exam in 2021 - Best of Lot

Hello guys, if you are preparing for Kuberfnetes Application developer certification or want to become a Certified Kubernetes Application developer (CKAD) and looking for the best online courses to prepare for this certification, then you have come to the right place. Earlier, I have shared the best courses to learn KubernetesDocker, and CKA courses. Today, I will share the best online courses to crack the Kubernetes Developer certification, also known as the CKAD. These are the best and most affordable online courses from Udemy, Pluralsight, and Whizlabs and help you prepare for crucial exam topics tested during the certification exam. Remember this is a hands-on exam, and you need solid experience and knowledge to pass this Kubernetes Developer certification.

17 Examples of Calendar and Date in Java - Tutorial

The java.util.Calendar class was added in Java on JDK 1.4 in an attempt to fix some flaws of the java.util.Date class. It did make some tasks simpler, e.g. create an arbitrary date comes easier using the new GregorianCalendar(2016, Calendar.JUNE, 11) constructor, as opposed to the Date class where the year starts from 1900 and the Month was starting from zero. It didn't solve all the problems e.g. mutability and thread-safety of Date class still remains, but it does make life easier at that time. Now with Java 8 everything related to Date and Time has become super easy and consistent but unfortunately, it will take another 5 to 10 years before the older version of Java goes away. Don't believe me, there are still applications running on JDK 1.5 which was released 12 years ago. The bottom line is it's still important to know about the Date and Calendar in Java.

How to Read/Write from RandomAccessFile in Java - Example Tutorial

Random access file is a special kind of file in Java that allows non-sequential or random access to any location in the file. This means you don't need to start from 1st line if you want to read line number 10, you can directly go to line 10 and read. It's similar to the array data structure, Just like you can access any element in the array by index you can read any content from the file by using a file pointer. A random-access file actually behaves like a large array of bytes stored in the file system and that's why it's very useful for low latency applications which need some kind of persistence e.g. in front office trading application and FIX Engine, you can use random access file to store FIX sequence numbers or all open orders.

Java 8 Comparator comparing() and thenComparing() Example - Tutorial

Hello Java programmers, you may know that the JDK 8 has added a lot of new methods into the Comparator interface which makes comparing and sorting objects in Java really easy. Two such methods are called comparing() and thenComparing() which was added in the java.util.Comparator interface. These methods accept a key extractor function and return a Comparator that can compare to that key. The key must be Comparable though like String, Integer, or any Java class which implements java.lang.Comparable interface, I mean the key must implement Comparable interface. 

Top 5 JUnit, Mockito, and Test Driven Development Courses for Java Programmers in 2021 - Best of Lot

Hello guys, if you want to learn Unit testing in Java and tools like JUnit, Mockito for test-driven development and looking for the best online Java testing courses, then you have come to the right place. Earlier, I have shared the best Java Programming courses, and today, we'll talk about JUnit and Unit testing, one of the critical skills for any Software developer. You may already know that JUnit and Mockito are two of the most popular testing libraries for Java applications, and you will find them in almost every Java application classpath. I often meet and work with Java developers who know Java well but haven't written a single unit test. 

Difference between JAX-RS, Restlet, Jersey, RESTEasy, and Apache CXF Frameworks

The JAX-RS is a Java specification request (JSR 311 & JSR 339) that standardizes the development and deployment of RESTful web services using Java and JEE technologies. It provides API in Java Programming language to create web services according to the REST (Representational State Transfer) architectural pattern. Both Restlet and Jersey are two of the most popular implementation of JAX-RS used for developing RESTful web services in Java ecosystem but there is a couple of other implementation also exist like Apache Wink, Apache CXF, and JBoss RESTEasy, along with omnipresent and the most popular option of creating REST web services with Spring Framework, Spring Boot, and Spring MVC

Top 5 Courses to learn WordPress for Beginners in 2021 - Best of Lot

Hello guys, if you want to learn WordPress to create online websites and start your career in web design and website development, you have come to the right place. In the past, I have shared the best courses to learn HTMLCSSJavaScriptBootstrap, and Web development, and today I will share about the best online training courses to learn WordPress. WordPress is one of the easiest ways to create a website. It's also one of the most essential tools for web designers and web developers. If you know WordPress, you can work on different kinds of companies like startups and even multi-national. WordPress also allows you to do a lot of freelancing work.

What are React and Redux Hooks? Example Tutorial

Hello guys, if you want to learn about Hooks in React.js like useState, useSelector, useEffect, and useDispatch then you have come to the right place. In the past, I have shared the best React courseswebsites, and books and in this article, I am going to show you what is React hooks and how they make coding and statement management easier in React.js. If you remember, React came out in 2013 and since then, it has become one of the biggest players in the front-end development community. Today, React's demand is more than any other framework or library. There are several reasons for its popularity. React is flexible, easy to learn, programmer-friendly, and most importantly, it's high performing. 

How to compare objects on natural order in Java? Comparable + compareTo Example

Java allows you to sort your object in natural order by implementing a Comparable interface. It's one of the fundamental interfaces of Java API and is defined in java.lang package, which means you don't need to implement this unlike its counterpart Comparator, which is defined in java.util package.  Comparable is used to provide natural order of sorting to objects e.g. numeric order is a natural order for numbers, alphabetic order is a natural order for String and chronological order is natural for dates. Similarly when you define your own objects like Person, Book, or Employee, sorting them by name sounds natural. Similarly, for teams, ranking seems their natural order. It all depends on how the object is looked into in its domain.

Top 10 Pluralsight Courses for React Developers - Best of Lot

Hello guys, if you are looking for the best React courses on Pluralsight, then you have come to the right place. Earlier, I have shared the best Pluralsight methods for Java developers, and today, I will share the best courses to learn React.js, one of the most in-demand skills for both Java and Fullstack developers. Pluralsight is one of my favorite learning websites because you can learn from subject matter experts and their courses are also well designed. They don't have giant classes of 50 hours, plus they have multiple courses where you can learn valuable skills in a couple of hours. That's what I like most because I never have that much time. 

Difference between Association, Composition and Aggregation in Java, UML and Object Oriented Programming

In Object-oriented programming, one object is related to another to use functionality and service provided by that object. This relationship between two objects is known as the association in object-oriented general software design and is depicted by an arrow in Unified Modelling Language or UML. Both Composition and Aggregation are the forms of association between two objects, but there is a subtle difference between composition and aggregation, which is also reflected by their UML notation. We refer to the association between two objects as Composition when one class owns other classes and other classes can not meaningfully exist, when the owner is destroyed.

Review - Introduction to Machine Learning Specialization by IBM on Coursera

Hello folks, if you are interested in Machine learning and looking for the best Machine learning course online, then you have come to the right place. Earlier, I have shared the best Machine Learning and Data Science courses, and in this article, I will review IBM's popular Introduction to Machine Learning Specialization in Coursera. IBM doesn't need an introduction, and this is a great course for anyone who wants to learn about Machine Learning, its importance, and its impact.  This course is carefully built by IBM's Machine Learning experts to teach you Machine learning through real-life examples and use cases; that's also one thing that makes it different from other courses. 

How to Filter Stream and Collections in Java 8? Example Tutorial

Java 8 provides excellent features to support the filtering of elements in Java Collections. Prior to Java 8, the only better way to filter elements is by using a foreach loop or iterating over Collection using the Iterator and selecting the required object, leaving out rest. Though that approach work, it was very difficult to run them in parallel and take advantage of multiple CPUs available in modern-day servers. Java 8 provides Streams, which not only makes it easy to run any operation parallel but also supports lazy loading and lazy evaluation, which means as soon as the filtering condition is satisfied, it stooped doing work, doesn't matter how many objects the collection contains.

How to use useDispatch and useSelector? React Hooks Example Tutorial

Hello guys, if you are learning about React hooks and wondering how to use useDispatch and useSelector hooks in React application then you have come to the right place. Earlier,, I have shared the best React courseswebsites, and books and in this article, I am going to show you how React hooks make coding and statement management easier than it was before. The introduction of React hooks changed a lot in the react application development. Developers moved from complicated and length class-based components to simpler functional components that can do the same work in fewer lines of code. 

Top 10 Udemy Courses for IT Professionals and Developers in 2021 - Best of Lot

Hello guys, Udemy, one of the most popular online learning platforms, is known for its sale where you can buy a $200 course for just $10, and they are rerunning a sale. It's actually a good time to buy some quality courses as you won't get another chance to buy the course at a price as low as $9.9, but the big question is which courses you should buy on Udemy in 2021? I always buy courses from the reputed instructor and something that teaches an evergreen and in-demand skill like Java, Python, Microservices, Docker, Kubernetes, and AWS. I generally buy a lot of courses in Udemy sales and then access them whenever I need them. Though, I must warn you Udemy is addictive, and I often buy more courses than I need, so beware of that and buy courses you need now or shortly.  

Top 5 Google Cloud Professional Architect Certification Courses & Practice Tests in 2021 [UPDATED]

Hello guys, if you are preparing for Google Cloud Architect Certification and looking for the best GCP Cloud Architect course, then you have come to the right place. I have shared about the GCP Cloud Engineer and Data Engineer Certification in the past, and today, I will share the best online courses for the GCP Cloud Architect Certification exam. If you want to enrich your CV or work with Google cloud platforms, but you're unable to decide which course is the right fit for you, then check out these great options. The list contains the best online training courses for the Google Cloud Certified Professional Cloud Architect exam from Udemy, Coursera, Whizlabs, and Pluralsight.

How HashMap works in Java

HashMap in Java works on hashing principles. It is a data structure that allows us to store object and retrieve it in constant time O(1) provided we know the key. In hashing, hash functions are used to link keys and values in HashMap. Objects are stored by the calling put(key, value) method of HashMap and retrieved by calling the get(key) method. When we call the put method, the hashcode() method of the key object is called so that the hash function of the map can find a bucket location to store the value object, which is actually an index of the internal array, known as the table.
HashMap internally stores mapping in the form of Map.Entry object which contains both key and value object.

Top 5 modern JavaScript features you should learn in 2021

Hello guys, if you are wondering what to learn in JavaScript to take your skills to the next level, then you have come to the right place. Earlier, I have shared the best Javascript courses and books. In this article, I will share essential modern Javascript features like arrow functions, let and const keywords, restructuring, spread operator, etc., to learn in 2021. JavaScript is the most popular and widely used programming language in the world. Over 90% of the websites use JavaScript in one way or other. 

StringTokenizer Example in Java with Multiple Delimiters - Example Tutorial

StringTokenizer is a legacy class for splitting strings into tokens. In order to break String into tokens, you need to create a StringTokenizer object and provide a delimiter for splitting strings into tokens. You can pass multiple delimiters e.g. you can break String into tokens by, and: at the same time. If you don't provide any delimiter then by default it will use white-space. It's inferior to split() as it doesn't support regular expression, also it is not very efficient. Since it’s an obsolete class, don't expect any performance improvement either. On the hand split() has gone some major performance boost on Java 7, see here to learn more about splitting String with regular expression.

Top 5 Java Programming Courses for Beginners to Learn Online in 2021 - Best of Lot

If you are a computer science graduate or someone who wants to learn Java and looking for some awesome resources like books, tutorials, and online courses then you have come to the right place. In the past, I have shared some great books, websites, and tutorials to learn Java and in this article, I am going to share some of the best Java courses beginners can join to learn Java in 2021. One of the main problems with learning Java is keeping pace with the increasing number of releases. For example, Java 8 release completely changed how Java is written and after that, we have many Java releases in the form of Java 9Java 10, Java 11, 12, 13, 14, 15,16, and now Java 17. But the good thing is that the core of Java is still the same and all its releases are backward compatible.

The 2021 Frontend and Backend Developer RoadMap [UPDATED]

Hello Guys, if one of your goals is to learn to code or to become a Web Developer in 2021, then I have something significant to share with you, the Complete Web Developer RoadMap. This is an excellent illustration of how to become a web developer in 2021 and guide you on how you can learn and master Web Development in 2021. It's a collection of different paths to learning front-end, back-end, and all other things a Web developer should know.  You will not just know about web development but about essential programming stuff which is necessary for all kinds of programmers.

5 ways to check if String is empty in Java - examples

String in Java is considered empty if it's not null and its length is zero. By the way, before checking length you should verify that String is not null because calling length() method on null String will result in java.lang.NullPointerException. Empty String is represented by String literal “”. The definition of empty String may be extended to those String as well which only contains white space but it's a specific requirement and in general String with white space is not considered as empty String in Java. Since String is one of the most frequently used classes and commonly used in method arguments, we often need to check if String is empty or not. Thankfully there are multiple ways to find if String is empty in Java or not.

Spring Data JPA @Query Example - Tutorial

Hello guys, if you are learning Spring Data JPA or using Spring Data JPA in your project and are not sure how to use @Query annotation then you have come to the right place. Earlier, I have shared the best Spring Data JPA courses and Spring Data JPA Interview questions and in this article, I am going to show you how to use @Query annotation from Spring Data JPA to create dynamic SQL queries. Spring is a popular Java application framework for creating enterprise applications and Spring Boot is an evolution of the Spring framework which helps to create standalone applications in a minimal effort. 

Difference between for loop and Enhanced for loop in Java? Example Tutorial

Though you can use both for loop and enhanced for loop to iterate over arrays and collections like a list, set, or map. There are some key differences between them. In general, enhanced for loop is much easier to use and less error-prone than for loop, where you need to manage the steps manually. At the same time, for loop is much more powerful because you get the opportunity to control the looping process. All the differences, you will learn in this article, stems from the very fact that traditional for loop gives more control than enhanced for loop but on the other hand enhanced or advanced for loop gives more convenience.

Top 5 Online Courses to Learn Puppet for DevOps in 2021 - Best of Lot

Hello guys, If you are interested in DevOps, you might have heard about Puppet, one of the most popular infrastructure automation tools. If you want to learn Puppet and looking for the best Puppet courses, then you have come to both the right places. Earlier, I have shared the best DevOps courses, and today, I am going to share the 5 best Puppet courses you can join to learn this useful DevOps tool. It is no surprise that automation and orchestration make life very easy, be it a small organization or a large-scale industry that houses hundreds of servers. Puppet plays an important role in infrastructure automation, such as creating and configuring application servers.

How to Convert Binary Number to Decimal in Java - Algorithm Example Tutorial

Problem: Write a Java program to convert a binary number into the decimal format, without using any library method which can directly solve the problem. You are free to use basic Java functions through e.g. those defined in java.lang and all kinds of Java operators e.g. arithmetic and logical operator, bitwise and bitshift operator, and relational operators.

Solution: Let's first revise some theory of the number system, which is required to convert a number from binary to decimal format. There are four kinds of number systems binary, octal, decimal, and hexadecimal. Binary is base 2 and that's why any number is represented using only two-digit, 0, and 1 also known as bits.

How to use Future and FutureTask in Java Concurrency with Example

Future and FutureTask in Java allows you to write asynchronous code. The Future is a general concurrency abstraction, also known as a promise, which promises to return a result in the future. In asynchronous programming, the main thread doesn't wait for any task to be finished, rather it hands over the task to workers and moves on. One way of asynchronous processing is by using callback methods. The Future class in Java is another way to write asynchronous code.

What is difference between Maven, ANT, Jenkins and Hudson?

In short, though Maven and ANT are build tools the main difference is that maven also provides dependency management, standard project layout, and project management. On the difference between Maven, ANT, and Jenkins, later is a continuous integration tool which is much more than a build tool. You can set up your CI environment using Jenkins or Hudson and automatically build, test, and deploy your Java project. Now last, the main difference between Jenkins and Hudson, both originate from the same source code but one is a closed source while the other is open source. You can read the details in this article.

Difference between OCPJP 8 Upgrade Exams 1Z0-813 and 1Z0-810? Which one to take?

Many Java developers who hold a Java certification either from Sun or Oracle and who are looking to upgrade to the latest Java version i.e. Java SE 8 certification have a common doubt, should they go for 1Z0-810 or 1Z0-813 upgrade exams? What are the differences between these two exams? Well, even though they are both upgrades to Java SE 8 exams, they are separate exams and have a different exam code, the difference is also obvious when you look at their title. The 1Z0-810 exam is known as "Upgrade Java SE 7 to Java SE 8 OCP Programme" while the 1Z0-813 exam is known as "Upgrade to Java SE 8 OCP ( Java SE 6 and all prior versions)".

7 Best Data Science Courses & Certifications on Coursera from Johns Hopkins University in 2021

Hello guys, if you are thinking to start a career in Data Science and Machine Learning and looking for the best resources then you have come to the right place. Earlier, I have shared the best Coursera courses to learn Software Development, Cloud Computing, and Web Development, and in this article, I am going to share the best online courses, and certifications from Johns Hopkins University to learn Data Science from scratch with both Python and R. John Hopkins University is one of the world-class universities based in Baltimore, Maryland. It was founded in 1876, and its also America's first research university and home to nine world-class academic divisions working together as one university. 

Top 5 Online Courses to become a Salesforce Developer in 2021 - Best of Lot

Hello folks, if you want to become a Salesforce developer and look for the best online training courses, you have come to the right place. Salesforce is customer relationship management used by companies to organize their works and keep the workflow up. Still, it is also a vast platform developer can use to create apps, develop them, customize them, and deploy them on a server. Salesforce has launched many certification programs for these purposes that allow you to learn how this platform works and how to use it, such as the Salesforce Platform App Builder and the Salesforce Administrator, and the Salesforce Development Training, which is required to become a Salesforce developer.

5 Free OCEJWCD 6 Mock Exam 1Z0-899 Practice Test

The OCEJWCD is Oracle's version of the SCWCD (Sun Certified Web Component Developer) exam, which tests the candidate's knowledge of Servlet, JSP, and other web technology. The OCEJWCD stands for Oracle Certified Enterprise Java Web Component Developer. Like other Java certifications like the OCAJP or OCPJP, the key to success is selecting a good book, practicing code daily, and then solving as many mock questions as possible.

How to create LocalDateTime in Java 8 - Example Tutorial

The LocalDateTime is a new class introduced in Java 8 new Date and Time API. This class is in java.time package and it represents both date and time information without timezone. In this example, you will learn different ways to create an instance of LocalDateTime class in Java 8 like by using the static factory method, or by combining LocalDate and LocalTime instances together, which are subsequently used to denote date without time and time without the date in Java 8. As their name suggests they are local, so they don't contain timezone information.

How to use state in react? Example Tutorial

Hello guys, I have just started a new series, React for Java developers and I am going to publish React tutorials and examples to teach React.js, one of the most popular frontend libraries to Java developers. Since most full-stack Java development is happening on React and Spring Boot, it makes sense for Java developers to learn React.js. In the past, I have also shared both best React courses and books, as well as The React Developer RoadMap, which provides all the tools, libraries, and resources you need to become a proficient React Developer. 

Top 5 UX/UI Design Courses & Certifications to Learn in 2021 - Best of Lot [UPDATED]

Hello guys, If you always wanted to learn UX design and become a UX designer and looking for the best UI/UX design online courses to start with, then you have come to the right place. In the past, I have shared the best web design courses and web development courses, and In this article, I will share the best UX online courses and certifications you can join to become a UX designer in 2021. The demand for UX/UI and Web Design professionals continues to increase in today's job market. Learning UI or UX skills can open doors to many jobs, both local and remote.  It goes without saying that certification in any discipline will give you a leg up on your job hunt.

3 ways to loop over Set or HashSet in Java? Examples

Since Set interface or HashSet class doesn't provide a get() method to retrieve elements, the only way to take out elements from a Set is to iterate over it by using the Iterator, or loop over Set using advanced for loop of Java 5. You can get the iterator by calling the iterator() method of the Set interface. This method returns an iterator over the elements in the sets but they are returned in no particular order, as Set doesn't guarantee any order. Though individual Set implementations e.g. LinkedHashSet or TreeSet can impose ordering and in such iterator will return elements on that order.

Java Comparator Example for Custom Sorting Employee by Name, Age and Salary

In this tutorial, we will see the Java Comparator example to sort an Employee object by name, age, and salary. In order to sort Employee object on different criteria, we need to create multiple comparators e.g. NameComparator, AgeComparator, and SalaryComparator, this is known as custom sorting in Java. This is different from the natural ordering of objects, provided by the compareTo() method of java.lang.Comparable interface. Though both compare() and compareTo() method looks similar they are different in the sense that, former accepts one parameter, while later accepts two-parameter. Former compare passed object to the current object, on the other hand, compare() method compares two different objects passed to it.

How to use Lambda Expression in Place of Anonymous Class in Java 8 - Example Tutorial

Before Java 8, the Anonymous class was the only way you can implement functional idioms in Java. Since prior to Java 8 you cannot pass a function to another function, you would have to wrap it into an object, as seen in Strategy Pattern. Those are also known as function objects in Java. Anonymous class was also handy to create a throw-away implementation of SAM (Single Abstract Methods) interfaces like RunnableCallable,  CommandListener, or ActionListener. Despite all these goodies and flexibility, the Anonymous class adds too much boilerplate code, making it hard to read and understand.

Top 6 Courses to learn GitLab CI/CD for Beginners in 2021 - Best of Lot

There are tons of tools in the DevOps world that address different phases of DevOps like create, package, deploy, secure, monitor, etc., but Gitlab does all of them, which is why GitLab is gaining a lot of Traction. Companies like Goldman Sachs, NVIDIA, SIEMENS are using GitLab to create an end-to-end DevOps platform. You can do source code management like Github, CI/CD like Jenkins and TeamCity, Configure infrastructure like Ansible and Puppet, and much more. If you are aiming to become a DevOps Engineer in 2021, then learning GitLab could be a game-changer as there are not many people with GitLab experience, and there is a great demand for IT professionals with GitLab skills. 

Reading/Writing to/from Files using FileChannel and ByteBuffer in Java - Example Tutorial

In the past, I have talked about RandomAccessFile and how it can be used for doing faster IO in Java, and in this Java NIO tutorial, we are going to see how to use read/write data from using FileChannel and ByteBuffer. Channel provides an alternate way to read data from a file, it provides better performance than InputStream or OutputStream. It can also be opened in blocking and non-blocking mode. Though FileChannles are read/write channels and they are always blocking, they cannot be put into non-blocking mode.

Python for Everybody Coursera Specialization Certification Review 2021

Hello guys, if you want to learn Python and looking for the best Python course on Coursera, or you are just wondering if the Python for Everybody course from the University of Michigan on Coursera is worth your time and money then you have come to the right place. Earlier, I have shared the best Coursera certifications for Python and  In this post, we will review Python for Everybody from the University of Michigan, the best Coursera specialization and certification for Python developers. If you are in a hurry and want a quick Yes/No answer whether you should join this Coursera specialization or not then our answer is Yes, by all means, you should go for it.

Difference between Functional and Non-Functional Requirements in Software development - Example

Gathering the correct and complete requirements is one of the most important things in software development. Incorrect and incomplete requirements are the main reasons why the project fails. If you are in software development, you may have come across terms like functional and non-functional requirements. If you are wondering why a prototype takes 2 weeks but actual application development requires around 3 to 4 months of development; think of non-functional requirement. When someone told you to build software, what they tell you is what that software should do like allow you to trade on a certain market, but they don't tell you about security, performance, load, and other stuff, this is what I called non-functional requirement. 

Coursera's Google IT Support Professional Certificate Review! - Is it worth in 2021?

Hello guys, if you are looking for a cost-effective and recognized IT training program to start your career in IT then you have come to the right place. In this article, we'll review Google IT Support Professional Certificate from Coursera which can be used to launch your career in IT support. If you are trying to get involved in the IT industry at an entry-level may because you need to be a programmer web developer, or even cisco certified so you have to learn the basics of information technology or maybe just for fun and learn how things work and educate yourself more about this amazing industry.

Top 5 Blogs Java EE developers should follow

One reason for Java's great success as a programming language is that it has dominated the Enterprise space. Earlier J2EE used to be the popular platform, but now we have a more modern and improved Java EE platform, with the latest release of Java EE 7. Java Platform, Enterprise Edition 7 provides new features that include enhanced HTML5 support, increases developer productivity, and further improves how enterprise demands can be met. One of the biggest advantages of Java EE 7 is the reduction of boilerplate code.

10 Difference between Primitive and Reference variable in Java - Example Tutorial

There are two types of variables in Java, primitive and reference type. All the basic types e.g. int, boolean, char, short, float, long and double are known as primitive types. JVM treats them differently than reference types, which is used to point objects e.g. String, Thread, File, and others. Reference variables are not pointers but a handle to the object which is created in heap memory. The main difference between primitive and reference type is that primitive type always has a value, it can never be null but reference type can be null, which denotes the absence of value. So if you create a primitive variable of type int and forget to initialize it then it's value would be 0, the default value of integral type in Java, but a reference variable by default has a null value, which means no reference is assigned to it.

Top 10 Free Courses to Learn Angular and React.js for Beginners in 2021 - Best of Lot

There is no doubt that both Angular and React (also known as Angular JS and React JS) are two of the most popular frameworks for modern web development, particularly front-end development. It was Angular who started the new way to develop a web application using JavaScript, but now React, and Vue.js are taking that to another level. I have seen more and more people are learning React in recent times. Btw, today's world is all about full-stack developers like you should know how to develop a web application end-to-end, starting from front-end to back-end, and that's why as a full-stack Java developer, you should React or Angular Framework.

Adapter vs Decorator vs Facade vs Proxy Design Pattern in Java

There is some striking similarity between Adapter, Decorator, Facade, and Proxy design patterns, in the sense that they all use Composition and delegation to solve the problem. The adapter pattern wraps an interface, and delegates call to it. The decorator wraps an object and implements behavior on top of that, Facade wraps one or more interfaces to provide a central interface, which is easy to use and Proxy Pattern also wraps Subject and delegates calls to it. Then questions come, why are different patterns? What is the difference between Adapter, Decorator, Facade, or Proxy pattern, if their structure is the same. The answer is Intent. Yes, all of these Java design patterns have similar structure and class diagrams but their intents are totally different from each other.

Difference between extends and implements keywords in Java? Example Tutorial

Though both extends and implements keyword in Java is used to implement Inheritance concept of Object-Oriented programming, there is a subtle difference between them. The extends keyword is mainly used to extend a class i.e. to create a subclass in Java, while the implements keyword is used to implement an interface in Java. The extends keyword can also be used by an interface for extending another interface. In order to better understand the difference between extends and implements, you also need to learn and understand the difference between class and interface in Java.

Why Default or No Argument Constructor is Important in Java Class? Answer

Almost all Java developers know that compiler adds a default constructor or better known as a no-argument constructor in every Java class, but many of them forget that it only does when you don't provide any other constructor. This means it becomes the developers' responsibility to add a no-argument constructor if he is adding an explicit constructor. Now, Why it's important to provide a default constructor in Java, What happens if your class doesn't have a no-argument constructor? Well, this is how it's asked in many Java interviews, most commonly as part of Spring and Hibernate interviews.

Difference between var, let, and const in JavaScript? Example Tutorial

Hello guys, if you want to understand the difference between var, let, and const in JavaScript then you have come to the right place. Earlier, I have shared the best books and JavaScript courses for beginners and in this article, I will tell you the difference between varlet, and const and when to use them. They are three different ways to declare variables in JavaScript. The var is the classic and old way to declare variables in Javascript and it can declare both local and global variables, while let and const are new ways to declare variables in Java and they have block scope, I mean they are only visible in the block they are declared. let is used to declare local variables while const is generally used to declare constants, I mean variable whose value doesn't change once initialized. 

3 Ways to Convert Java 8 Stream to an Array - Lambda Expression and Constructor Reference Example

One of the frequently asked Java 8 interview questions is, how you do convert a Java 8 Stream to an array? For example, you have a Stream of Strings and you want an array of String so that you can pass this to a legacy method that expects an array, how do you do that? Well, the obvious place to search is the Javadoc of java.util.stream.Stream class and there you will find a toArray() method. Though this method will convert the Stream to an array it has a problem, it returns an Object array. What will you do, if you need a String array? Well, you can use the overloaded version of the toArray(IntFunction generator), which expects a generator function to create an array of the specified type.

2 solution of java.lang.OutOfMemoryError in Java

Everyone in java development faces java.lang.OutOfMemoryError now and then, OutOfMemoryError in Java is one problem which is more due to the system's limitation (memory) rather than due to programming mistakes in most cases though in certain cases you could have a memory leak which causing OutOfMemoryError. I have found that even though java.lang.OutOfMemoryError is quite common basic knowledge of its cause and the solution is largely unknown among junior developers. Beginners books like Head First Java don't teach you much about how to deal with this kind of error. You need real experience dealing with production systems, handling a large number of user sessions to troubleshoot and fix performance issues like running out of memory.

Top 5 Online Courses to Learn Flutter in 2021 - Best of Lot

If you are like me, who thinks Flutter is the future of mobile development and looking for some excellent online courses to learn Flutter, then you have come to the right place. In this article, I am going to share some of the best online courses to learn Flutter in 2021 from Udemy, Pluralsight, and Coursera, but before going into that, let's see what Flutter is and why everyone is so excited about it. Well, in general, whenever something comes from Google, it makes a lot of developers excited like Angular, Dart, and now Flutter. I have got my hand dirty in both Android and iOS using Java and Objective-C in the past, but after working for some time, I decided to move on.

How to enable SSL debugging in Java JVM? Example

Dealing with SSL issues in Java web applications is no fun, especially when you have no debug or troubleshooting logs and all you see is an ugly ‘Page Cannot be displayed error message in your browser. Thankfully you can easily enable SSL to debug on your Application to start seeing verbose logs that will clearly show what happens during the SSL handshake process.

Top 5 Java 8 Practice Test and Exam Simulators (OCAJP and OCPJP) - Best of lot

Apart from books, exam simulators are another essential tool to prepare for Java certifications. They not only give you the opportunity to test your knowledge topic-wise but also provide a helpful explanation to clear your doubt and misconception, which means you can learn on the fly. Actually, when I prepared for my SCJP exam, I learned a lot of new concepts by just giving mock exams and solving practice questions. Since most of the Java certification aspirants are Java developers with some experience i.e., they have done a good amount of coding, they can easily understand the code, but they might not be familiar with the exam format.

Java Multithreading Tricky Interview Question - Calling run() instead of start() Method Example

Hello guys, writing multi-threaded and concurrent programs is not easy, not even in Java.  Even senior developers, including myself, make mistakes while writing concurrent Java applications. This is also one of the trickiest areas of Java programming language, where misconceptions outnumber concepts. Considering the amount of misconception an average Java programmer has about multi-threading and concurrency, I thought to start a new series about common multi-threading mistakes done by Java programmers; what is a better way to learn from common real word mistakes.

How to convert java.util.Date to java.sql.Timestamp? Example Tutorial

You can convert a java.util.Date to java.sql.Timestamp value by using the getTime() method of Date class. This method returns the long millisecond value from Epoch (1st January 1970 midnight) which you can pass to java.sql.Timestamp to create a new instance of Timestamp object in JDBC. Remember, java.sql.TimeStamp class is a wrapper around java.util.Date to allow JDBC to view it as SQL TIMESTAMP value. The only way to create a Timestamp instance is by passing the long time value because the second constructor of the Timestamp class, which accepts individual fields like a year, month, date, hour, minute, second, and nano is deprecated. Timestamp class can also hold up to nanosecond value.

Top 5 Books to learn Cloud Computing in 2021 - Best of Lot

Hello guys, if you want to learn Cloud Computing like AWS, Google Cloud Platform, or Microsoft Azure, or any Cloud computing platform and looking for the best resources then you have come to the right place. Earlier, I have shared both the best Cloud Computing Courses for beginners as well as some free cloud courses to start with. And in this article, I am going to share the best books to learn about Cloud Computing for Beginners. The list not only includes books to learn Cloud Computing fundamentals and basic concepts like IaaS, Pass, Saas, etc but also book which covers popular Cloud computing platform like AWS

How to get the last modified date and time of a File or Directory in Java? Example Tutorial

Sometimes before processing a file, you want to check its last modified date to avoid processing an old file. Though some programmers prefer to attach the date in the file name itself, I don't find it a cleaner approach. For example, suppose you are downloading closing prices of stocks and processing them at the start of the day, and loading them into the database. In order to accidentally process an old file, you can check the last modified date before processing and if it's in the acceptable range, you can process the file. You can get the last modified date of a file in Java by using java.io.File class. 

How to create RESTful Web Services using Restlet Framework in Java - Example Tutorial

Hello Java developer, if you are looking for an example of how to create RESTful web services using Restlet Framework in Java and Eclipse then you have come to the right place. Earlier, I have shared the best REST API Courses and in this tutorial, I will show you how to use Restlet for creating REST APIs in Java. The Restlet is one of the first open-source frameworks to create and deploy RESTful web services in Java. After the release of JAX-RS (Java API for RESTful Web Services) JSR - 317, Restlet also supports JAX-RS annotation and provides a consistent way to create both RESTful Server and Client. HelloWorld program is the traditional way to start with new technology and continuing to the tradition, we'll write our first Restlet program as HelloWorld. 

Top 5 Courses to Learn C Programming in 2021 - Best of Lot

Hello guys, today, I will talk about one of the oldest, reliable, powerful programming languages that have survived for 50 years. Yes, that's right, 50 years. It's a great achievement for any technology to remain relevant for such a long period. If you don't know, the C Programming language is one of the first general-purpose programming languages, invented by Dennis Ritchie and Ken Thomson around 1969. Ken was writing UNIX, another accessible technology that has survived for 50 years around the same time and needed a programming language that can do all kinds of tasks; the result was a C programming language.

Difference between GETDATE() vs SYSDATETIME() vs GETUTCDATE() in SQL Server - Examples

One of the common questions on the Microsoft SQL Server interview is, what is the difference between GETDATE(), SYSDATETIME(), and GETUTCDATE(). Even though all three SQL Server function returns the current date-time in SQL Server, there are some subtle differences between them. The main difference between GETDATE() and SYSDATETIME() is that GETDATE returns the current date and time as DATETIME but SYSDATETIME returns a DATETIME2 value, which is more precise.

Top 5 Courses to Learn Angular Framework in 2021- Best of Lot

If you are a Web developer or someone who wants to learn Angular for web development and looking for some excellent resources, like books, online courses, and tutorials, then you have come to the right place. In the past, I have shared some of the best Angular tutorials, and today, In this article, I am going to share some of the best Angular courses to learn modern-day web development. If you don't know what Angular is and how it helps you to develop modern-day web development, let me give you a brief overview. It's a Javascript front-end framework that allows you to build a modern big e-commerce web application as well as a single-page web application that runs on a browser.

Top 10 Coursera Courses to Learn AWS, Google Cloud, Azure, and Cloud Computing in 2021

Hello guys, Cloud Computing is an in-demand skill for programmers, Software Developers, and any IT professionals, including support engineers, sysadmins, and even QA and business analysts. In the last few years, more and more companies have moved to the cloud, and most technical development is happening there. Hence Cloud computing has become an essential skill to service the tech world. If you want to become a Cloud developer or administrator or just want to know about Cloud computing, you have come to the right place.

Difference between PUT and POST in REST Web Services in Java - Example

If you remember REST WebServices uses HTTP methods to map CRUD (create, retrieve, update, delete) operations to HTTP requests. Even though both PUT and POST methods can be used to perform create and update operations in REST WebServices, Idempotency is the main difference between PUT and POST. Similar to the GET request, the PUT request is also idempotent in HTTP, which means it will produce the same results if executed once more multiple times. Another practical difference between PUT and POST methods in the context of REST WebService is that POST is often used to create a new entity, and PUT is often used to update an existing entity.

Top 7 Free and Best DataCamp Courses to learn Python, SQL and Data Science

Hello guys, if you are looking for the best Datacamp courses to learn Python and SQL and become a Data Scientist in 2021, then you have come to the right place. In the past, I have shared the best udemy courses to learn Python and the best courses for data science. In this article, I will share both free and best Datacamp courses for Python developers and Data Science learners. Yes, you read it write, Datacamp also offers free courses and they are quality courses which you can take to learn at the skill on your own. If you don't know, Datacamp is a great platform to learn Data skills, and it has the best courses to learn Data skills like SQL, Data Science, and Python. 

Top 5 Free Git Courses for Programmers to Learn Online in 2021 - Best of Lot

One of my goals is to learn and master Git and Github this year and I have been searching for some good tutorials and courses to start with. The Internet is full of git tutorials and a simple Google search will leave you thousands of tutorials but the big question mark is where do you start? It's easy to pick a tutorial or a blog post if you have some background about what is Git, what it does? and how to use it but if you don't have much background then you need a course that can tell you all the information from the ground up. I personally like learning from a book or an online course before moving to blog posts as they were often well structured.

Top 5 Courses to Learn SQL and Database in 2021 - Best of Lot

Hello guys, if you are a computer science graduate or new to the programming world, interested in learning SQL, and looking for some excellent resources, like books, courses, and tutorials to start with, then you have come to the right place. In the past, I have shared some of the best SQL books and tutorials, and today I am going to share some of the best SQL and database courses to learn and master this useful technology. If you don't know what SQL is and why you should learn it, let me give you a brief overview of SQL for everyone's benefit. SQL is a programming language to work with a database. You can use SQL to create database objects, like tables, stored procedures, etc., and also to store and retrieve data from the database.

How to replace a substring in Java? String replace() method Example Tutorial

You can replace a substring using replace() method in Java. The String class provides the overloaded version of the replace() method, but you need to use the replace(CharSequence target, CharSequence replacement). This version of the replace() method replaces each substring of this string (on which you call the replace() method) that matches the literal target sequence with the specified literal replacement sequence. For example, if you call "Effective Java".replace("Effective", "Head First") then it will replace "Effective" with "Head First" in the String "Effective Java". Since String is Immutable in Java, this call will produce a new String "Head First Java".

How to check if ResultSet is empty in JDBC Java - Example Tutorial

The JDBC ResultSet doesn't provide any isEmpty(), length() or size() method to check if its empty or not. Hence, when a Java programmer needs to determine if ResultSet is empty or not, it just calls the next() method and if next() returns false it means ResultSet is empty. This is correct but the main problem with this approach is if the ResultSet is not empty then you may miss the first row if you follow the standard idiom to iterate over ResultSet and get the rows that involve calling the next() method of ResultSet in a while loop.