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.

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.