HTML

How to Reverse a String in place in Java - Example

One of the common Java coding interview questions is to write a program to reverse a String in place in Java, without using additional memory. You cannot use any library classes or methods like e.g. StringBuilder to solve this problem. This restriction is placed because StringBuilder and StringBuffer class define a reverse() method which can easily reverse the given String. Since the main objective of this question is to test the programming skill and coding logic of candidate, there is no point giving him the option to use the library method which can make this question trivial. Now, how do you solve this problem? If you are familiar with array data structure then it would be easy for you. Since String is backed by a character array, you can use the same in place algorithm we have used to reverse an array in place.

5 Free HTML and CSS Courses to Learn Front End Web Development Online

HTML and CSS are two pillars of web development, they are used to create web pages you see every day. HTML provides the structure to your web page and CSS provides them the style to look better. If you want to become a front-end web developer or web designer then a good knowledge of HTML and CSS is a must. Even though modern day web development is all about framework and library e.g. Angular and React, you still need to know HTML and CSS to understand what's going on and troubleshoot any issue you face while developing a web application. Btw, JavaScript is another pillar of web development but we'll not discuss this article. I have already shared some good books and courses to learn JavaScript before

Top 20 System and Software Design Interview Questions for Java Programmers

System design questions are an important part of programming job interviews and if you want to do well, you must prepare this topic. In the past, when I shared my list of programming interview questions, I have shared a couple of System design questions but my readers kept asking me for more questions, as it is a hard topic to master and more and more practice is needed. I had my own list of questions which I have collected from various interviews with friends and colleagues but I needed more questions for this article and my own preparation then I stumbled upon the Grokking System Design Interview course. It's an excellent resource because it not only gives you a lot of System design question but also provide all the knowledge and tools you need to solve those questions.

10 Books Java Developers Should Read in 2019

Hello guys, If you are Java developer and wondering what to read in 2019 then you have come to the right place. In this article, I am going to 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, and Spring 5 features and thinking of learning Kotlin to improve their productivity, but I have not forgotten to junior and less experienced Java developers or some who are thinking to start their journey into Java world in 2019.

Difference between table scan, index scan, and index seek in SQL Server Database

Good understanding of Indexes is very important while working in a database and SQL and that's why you will find many questions based upon indexes on Programming Job interviews. One of such frequently asked SQL question is the real difference between table scan, index scan, an index seek? which one is faster and why? How does the database chooses which scan or seek to use? and How you can optimize the performance of your SQL SELECT queries by using this knowledge. In general, there are only two ways in which your query engine retrieves the data, using a table scan or by using an index. Which method is used for your particular query depends upon what indexes are available in that table, what columns you are requesting in your query, the kind of joins you are doing, and the size of your tables.

7 Free Selenium Courses to Learn Automation Testing in Java

Testing is an integral part of software development and we have long been relied on manual testing by testers and QA professional to ship quality software and find bugs, but that's not sustainable anymore. There is an increased focus on automation testing nowadays and Selenium is leading the way with its web drivers. If you don't know what is selenium, it's a free automation testing tool for web applications. It can work with different web browsers like Chrome, Firefox, Internet Explorer, Opera and simulate human-like behavior. By using Selenium you can programmatically interact with all the different elements in a webpage. You can click on them, input text, extract text and so much more.

How to Format Date to String in Java 8 and Before - Example Tutorial

One of the common programming task 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 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 classes changes.

Top 5 Free TypeScript Courses for Angular Developers to Learn Online - Best of Lot

If you are interested in learning TypeScript or Angular, one of the popular JavaScript framework for developing front-end, which uses TypeScript and looking for some resources e.g. books, tutorials and courses then you have come to the right place. In this article, I am going to share some of the best, free TypeScript online courses you can use to learn this powerful programming language. For those who don't know TypeScript, it's a new dynamically typed programming language from Microsoft which augments JavaScript's programming syntax by adding some new features which help in object-oriented application development, particularly introduction of Types.

Why Programmers Should NOT use SELECT * in SQL Query

I have read many articles on the internet where people suggest that using SELECT * in SQL query is a bad practice and you should always avoid that, but they never care to explain why? Some of them will say you should always use an explicit list of columns in your SQL query, which is a good suggestion and one of the SQL best practices I teach to junior programmers, but many of them don't explain the reason behind it.  Unless you explain some reasons why one should not use SELECT * in queries, it's difficult to convince many SQL developers,  many of whom have started learning SQL by doing SELECT * from EMP in Oracle database. In this article, I will try to bridge that gap by giving some practical reasons why using SELECT * in SQL query is not a good idea.

Java 8 ConcurrentHashMap compute() and computeIfPresent() 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 become 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.

5 Free Servlet, JSP, and JDBC Online Courses for Advanced Java Developers

If you are a Java developer working on a Java JEE projects like a Java Web application running on Tomcat or Glassfish, or you want to get into that by learning server-side technologies like Servlet, JSP, and JDBC then you have come to the right place. In this article, I will share some free online courses to learn Servlet, JSP, and JDBC at your own pace. If you want to become a rockstar Java web developer then you must have a good understanding of these basic web technologies before you learn frameworks like Spring and Hibernate. These frameworks work on top of these basic technologies and if you don't know them then you would often struggle to debug and troubleshoot problems in the real world.

Difference between ISNULL() and COALESCE() function in SQL

Even though both ISNULL() and COALESCE() function provides alternate values to NULL in T-SQL and Microsoft SQL Server e.g. replacing NULL values with empty String, there are some key differences between them, which is often the topic of SQL Server interview. In this article, you will not only learn the answer to this question but also learn how to use COALESCE and ISNULL function properly. One the main difference between them is that  COALESCE() is a standard SQL function but ISNULL() is a Microsoft SQL Server specific, which means it's not guaranteed to be supported by other database vendors like Oracle, MySQL or PostgreSQL.

5 Good Books to Learn Java 8 Functional Programming

Hello guys, recently I asked my followers on Twitter which Java version they are using in production and most of them said Java 8. This is not surprising at all because many of the project I have worked also using Java 8 in production. After close to 5 years of Java 8 release, it is still the most used Java version in production. Even though we now have Java 12 many programmer are yet to learn Java 8 and I often receives queries like which books to read or which courses to follow. If you are learning Java 8 features like lambda expressions, Stream API, and functional programming in Java and looking for some exciting books and resources then you have come to the right place. In the past, I have shared some of the best Java 8 tutorials and courses and today I'll share some of the best books you read to learn Java 8 better.

Top 5 Free Ruby and Rails Courses to Learn Online - Best of Lot

Hello guys, welcome to this post, here you will find some of the best free courses to learn Ruby programming language and Ruby on Rails framework online. If you don't know what is Ruby and what is Rails framework then let me tell you that its one of the simplest programming language with little to no syntax. If you are new to programming or never coded before then also developing a Ruby application will be much easier than choosing any other programming language like Python or Java. When it comes to developing web development, the Ruby on Rails also makes your job easy by making several useful assumptions based upon convention, which means you can do more by writing less code.

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

One of the common tasks in Java programming is to convert a list to 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 map because they are two different data structure. For example, the list 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. Similarly, another concern is order. A list is an ordered collection but the map doesn't guarantee any order unless you decide to use LinkedHashMap, which keeps insertion order or TreeMap which keeps mapping in the sorted order of keys. This is one of the important details which many Java beginners forget and then spend hours to chase subtle bugs.

7 Examples to Sort An Array in Java

Sorting array is a day-to-day programming task for any software developer.  If you have come from Computer Science background then you have definitely learned fundamental sorting algorithms like the bubble sort, insertion sort, and quicksort but you don't really need to code those algorithms to sort an array in Java because Java has good support for sorting different types of array. You can use Arrays.sort() method to sort both primitive and object array in Java. But, before using this method, let's learn how the Arrays.sort() method works in Java. This will not only help you to get familiar with the API but also it's inner working.  This method sorts given array into ascending order, which is the numeric order for primitives and defined by compareTo() or compare() method for objects.

10 Great Resources for Programming Job Interview Questions

If you are a fresher or final year graduate preparing for your placement interview, or a Java developer preparing for your next job and looking for some websites, blogs, and forums for programming interview questions then you have come to the right place. In this article, I am going to share some of the really good websites and resources which will help you to prepare and do well on programming interviews. Though there are a large number of good books with lots of programming questions like Cracking the Coding Interview and Programming interview exposed, they are not the most interactive or comprehensive resources. Since with times, interviews are also changing you need to keep yourself updated with latest programming job interviews and Java questions.

22 Array Concepts Interview Questions Answers in Java

An array is one of the fundamental data structure and most of other advanced data structures like list, 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 on Java interviews. There are two types of question 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 interview and second is usually asked on written test and face-to-face interviews.

Top 5 Free Courses to Learn Web Development in 2019 - Best of Lot

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

Can you make an Abstract Class/Method Final in Java?

No, you cannot make an abstract class or method final in Java because the abstract and final are the mutual exclusive concept. An abstract class is incomplete and can only be instantiated by extending a concrete class and implementing all abstract methods, while a final class is considered as complete and cannot be extended further. This means when you make an abstract class final, it cannot be extended hence it cannot be used and that's why Java compiler throws a compile-time error when you try to make an abstract class final in Java. In short, an abstract class cannot be final in Java, using both abstract and final modifier with a class is illegal in Java.

Java - Convert String to Short Example

In last a couple of examples, I have taught you how to convert String to Integer, Long, Double, Float, Boolean, and Byte in Java and today I will show you how to convert String to Short in Java, but before that let's revise what is short data type in Java. The short is an integral data type similar to the int but it only takes 2 bytes to store data as compared to 4 bytes required by an int variable. Since it takes only 2 bytes or 16 bits to store data, the range of short is also shorter than int. It ranges from -32,768 to 32767 (inclusive) or -2^15 to 2^15 -1. You might be wondering why upper bound is 255 and lower bound is -256 but that's because we have included zero in between.

Linux Crontab Command Example - How to backup and load Cron Jobs from a File in UNIX

If you have been using Linux for some time then you might know about cron jobs. They are the scheduler which can be used to automatically start processes in a Linux box. I have worked on many projects which used cron jobs to start the Java process and environment daily or weekly basis. They are similar to Autosys when it comes to scheduling job but cron is a Linux command as opposed to Autosys which is separate application altogether. In Linux, crontab command is used for scheduling and automating jobs or process. You can also use it for loading cron jobs from a file, listing existing cron entries, and editing them. It manages the cron table that is used by the cron daemon in Linux to execute the cron jobs.

Top 20 Hibernate Interview Questions for Java J2EE Programmers

Hibernate is one of the most popular persistent frameworks in the Java world. Hibernate offers an object to relational (ORM) solution which frees Java developers from writing tedious, hard to read and cluttered JDBC code converting SQL columns into Object properties. Apart from freeing Java developer from writing JDBC and database interaction code, Hibernate also offers the out-of-box solution on caching, proxying and lazy loading which drastically improves the performance of your Java Web application. Given it's important in Java Web application development field Hibernate has become of one of the most sought-after skill and goes hand in hand with Spring framework. That's why Spring and Hibernate interview questions are also very popular in Java interviews, particularly for web development positions.

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

Hello guys, In today's article we are going to discuss one interesting and important Spring MVC concepts, 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 is 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.

5 Free Oracle and Microsoft SQL Server Online Courses

If you are an application developer e.g. someone developing a server-side application using Java or .NET or any other programming language which uses a database like Oracle and Microsoft SQL Server or a junior DBA then you must learn these database technologies to effectively work in your Job. Even though your organization might have DBAs or Database Administrators to help you with the database, more often than not, it's application developers who end up writing SQL scripts to create data, upload data, query data, and writing complex stored procedures and triggers to implement application functionalities. DBAs job mostly does database installation, access control, security, and other database admin stuff.

When and How to use the wait() and notify(), nofityAll() methods in Java? - Example Tutorial

When should you use the wait() and notify method in Java is one of the many popular questions about the wait and notify methods from Java multithreading interview questions. One of the reasons for its popularity is that still a lot of Java programmer struggle to explain and write code using wait-notify methods.  Many Java developer only knows some facts about the wait and notify methods like that wait() and notify() are defined in the java.lang.Object class or you cannot call wait() without synchronization, means without a synchronized block or synchronized method but doesn't really know when and how to use them.

Java 8 Stream findFirst() and filter() Example

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.

3 Books and Courses to Learn RESTful Web Services using Spring and Java

Hello guys, if you know Spring framework then there is a good chance that you have heard about the classic Spring in Action book by Craig Walls. It's one of the best books to learn Spring and many Java developers, including me, has learned Spring from that. But, even though the Spring in Action 5th Edition is one of the best books to learn Spring framework, it's just not enough to learn intricacies of developing a modern, full-featured RESTful Web Service using Spring Framework. It does have a chapter on developing RESTful Web Services and nicely explains concepts like @RestController, @ResponseBody, @ResponseStatus, HTTP message converters, content negotiation but that barely touch the surface of developing a production quality RESTFul Web Service.

10 Essential JVM Options for a Java Production System

Hello guys, this is a brief guide of important JVM options which you will often see in production Java systems. As a Java developer, you should know what these JVM options means, 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 e.g. 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.

Top 5 Free C++ Courses to Learn Programming Online - Best of Lot

C++ is one of the most popular and powerful object-oriented programming languages and if you want to do low-level stuff then it's the best language to start with. Most of the complex software e.g. Operating Systems, Database Management Systems, and Powerful trading systems are written in C++. While many of us have learned to program by using C and C++, let me honest with you learning C++ is challenging. There are many areas which are tough to grasp e.g. points but you will learn them slowly and that's where these free C++ course will help you.

ContextLoaderListener in Spring MVC - 10 Things Java Programmer Should Know

The ContextLoaderListner is one of the important components of the Spring MVC framework, probably the most important after DispatcherServlet itself. It is used to create root context and responsible for loading beans which are shared by multiple DispatcherServlet like beans related to the service layer and data access layer. In general, When you develop Spring MVC based web application and also using Spring in the services layer, you need to provide two application-contexts. The first one is configured using ContextLoaderListener and the other is configured using DispatcherServlet. The DispatcherServlet is responsible for loading web component specific beans like controllers, view resolvers and handler mappings while as I said before, ContextLoaderListener is responsible for loading middle-tier and data-tier beans which forms the back end of Spring applications.

10 Tools Java Developers Should Learn in 2019

We are just a week away to 2019 and many programmers have already started making a good process to their goals for 2019, which is very good, but if you are someone, who is still not sure what to learn in 2019 then you have come to the right place. In past, I have shared 10 things Java developers to learn in 2019 and last week I published top 5 Java Frameworks to learn, but there is one topic which kept coming from my readers.  The question which I have received this week a couple of times form my fellow Java developers and readers is which tools Java programmers should learn in 2019? or what are some good Java tools used in application development? and finally, what should I learn in 2019? I have been answering this question by writing blog posts e.g. 10 Testing Tools Java developers should learn in 2019 and in this article, I am going to share some of the best Java tools you can learn in 2019.

Decorator Design Pattern in Java with Example

The Decorator design Pattern is one of the famous Gang of Four (GOF) structural design pattern, which provides a dynamic way of extending an object's functionality. It's different than the traditional way of adding new functionality into an object using Inheritance, instead, it uses Composition which makes it flexible and allows to add new functionalities at the run time, as opposite to Inheritance, which adds new functionality at compile time. Because of this flexibility, Decorator is one of the darling patterns for many Java developer. Btw, like many others object-oriented design patterns, the decorator design pattern is introduced by the famous Gang of Four design pattern book, almost 2 decades ago. This means it's a time-tested way of adding new functionalities into an object.

30+ Spring MVC Framework Interview Questions Answers for Java/JEE Developers

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

How to Read a CSV file with Header in Java using Jackson with Example

Hello guys, today I am going to show you how to read a CSV file in Java with a simple example of Jackson API. For a long time, I only knew that Jackson can be used to parse JSON but later realized that you can also use it to parse or read CSV file in Java. The Jackson DataFormat CSV library allows you to read a CSV file in just a couple of line and its really powerful and feature rich. For example, you can read a CSV file with a header or without a header. You can even read a tab-delimited text file like CSV. It's also highly configurable and allows you to define columns separator to read a text file with any delimiter. You can even use it to directly convert the CSV data into Java objects, just like we do while reading JSON String in Java.

Top 35 Java String Interview Questions with Answers

The  String class and concept is a very important class in Java. There is not a single Java program out there which is not using String objects and that's why it's very important from interview point of view as well. In this article, I am going to share 35 String based questions from different Java interviews. It includes questions on java.lang.String class as well as a string as data structure e.g. some coding questions something like I have shared in my earlier article about 75 Coding questions to Crack any Programming Job interviews.  You can use this list to refresh your knowledge about String in Java as well as to prepare for your next Java interview. If you have any good String questions which are not on this list, feel free to drop a note and I'll include in this list.

5 Free Object-Oriented Programming Online Courses for Programmers

The OOP or Object Oriented Programming is a paradigm which allows you to write a program by modeling real-world things in terms of class and object. It not only make to represent a real-world thing in the programming world easier but also allow you to manage the complexity of your program. Even though there are several programming paradigms e.g. procedural and functional, most of the code we write today is object-oriented and some of the most of popular programming languages are object-oriented e.g. Java, Python, PHP, and JavaScript all supported object-oriented programming.

10 Example of LocalDate, LocalTime, and LocalDateTime in Java 8

It's been almost 5 years since Java SE 8 was released on 17th March 2014 and Java 8 adoption has come a long way. Java programmers around the world have accepted with both ends, many companies have switched their development on Java 8 and several others are migrating to Java 8 platform. At this time, its extremely important for a Java developer to learn and share his Java 8 skill and that just not include lambdas, stream, method reference, functional interface, and other more glamorous stuff, you also need to learn the new Date and time API, which you would find using more regularly in your day to day life.

How to Convert Hostname to IP Address in Java - InetAddress Example

Hello guys, today, I am going to teach you about one interesting class from java.net package, the InetAddress. If you have never used this class before, let me tell you that it's an abstraction to represent an Internet address and it encapsulates both hostname and IP address. Since converting an IP address to hostname or hostname to IP address is a very common requirement, Java developer should know about this class, and, in general about java.net package, which contains much other useful class for networking and client-server applications. So, what is the best way to learn new APIs like java.net? Well, by writing small programs like this, which has a small focus and let you explore things. They are super useful and that's how I have learned the majority of Java API.

How to Find the Largest and Smallest of Three Numbers in Java

Hello guys, today, I am going to share with you another interesting coding problem for beginners, how to find the largest and smallest of three numbers. If you are learning how to program or looking to improve your problem-solving and coding skill then these kind of small problems are good to start with. They not only provide you an opportunity to think how to solve a problem using basic programming constructs like conditionals (if, else, if-else, switch), loops (for, while, do-while), operators like arithmetic, bitwise and logical operator as well as teach you how to write functions, class and create a program which you can run.

10 Top Programming Languages of 2019 By Salaries

Since last a couple of the week, I have been doing some research about what to learn in 2019 when I stumbled about StackOverflow's Developer Survey. It's one of the best surveys for software developers, which provides useful insights about programming and IT world. One of the things I really like about this survey was its several lists like the list of top 10 programming languages and the most loved frameworks by programmers, but the one I found most useful was the list of top paying technologies. This is a great list and allow you to choose what you can learn in 2019 to go to the next level in your career in terms of both financial and career growth.

Top 10 Java 9 Tutorials and Courses - Best of Lot Must Read

It's been more than a year or so since JDK 9 was launched and the new year is probably the best time to learn Java 9 and get yourself familiar with new features and enhancements on existing APIs. The highlight of JDK 9 release was Project Jigsaw or Module system. The Java 9 Platform Module System allows Java to move forward by modularizing the JDK as well as adding modules as first-class citizens to Java, but that's not the only thing to look forward, there are many small changes which are very useful in day-to-day coding. For me the static factory methods introduced in List, Set, and Map to create a immutable list, set and the map is the most interesting one. Along with several changes on Stream API and Optional class. Those are the ones, I will most likely to use as soon as we start with JDK 9.

Top 21 Java HashMap Interview Questions and Answers

The java.util.HashMap is one of the workhorses of JDK. Along with ArrayList, it is one of the most used classes from Java's collection framework. There is hardly a real-world Java project, where I haven't seen the use of HashMap. It is an implementation of hash table data structure and it's not a surprise that HashMap is so useful, as someone has rightly said, "if you could have just one data structure, make it a hash table". The hash table data structure allows you to search for a value in O(1) time if you have key. In Java, there are several implementations of hash table data structure exists like Hashtable, ConcurrentHashMap, LinkedHashMap, etc but HashMap is your general purpose map.

A Beginners Guide to Array in Java

Without any doubt, the array is one of the most used data structure in all programming languages, including Java. Pick up any programming language be it functional, object-oriented, imperative or even scripting languages like Python, Bash, and Perl, you will always find array. That's why it's important for any programmer to have a good understanding of the array data structure. Like any other data structure, the array also provides a way to organize and store objects, but the way it does makes all the difference. An array is used to store elements in the contiguous memory location and many C, C++ programmer can take advantage of a pointer to work with an array.

Why wait() and notify() method should be called inside a loop in Java?

If you have used wait() and notify() method in Java then you know that the standard idiom of calling wait() method uses a loop, but have you ever thought why? This is even advised by none other than Joshua Bloch, a Java guru and author of popular Effective Java book, must read for any Java programmer. When I first started using this method, I was puzzled why not just use the if block because ultimately we are testing for a condition and then either waiting or going for further processing. An if block is more readable for the testing condition than a while loop like for the classic producer-consumer problem, the waiting condition for producer thread could be written as :

5 Free DevOps Courses to Learn Jenkins, Docker, and Kubernetes for Programmers

Hello guys, you might have heard about DevOps and all the attention it is getting now. The 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 certainly 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 DevOps world, tools matters a lot and whole of the DevOps phenomenon to create an automated pipeline for delivering a quality software heavily relies on cleaver uses of tools like Maven, Jenkins, Docker, Kubernetes, and others.

How to Check if a Key Object Exists in HashMap Java? containsKey() Example

Hello guys, you might know that one of the common programming tasks while using HashMap in Java is to check if a given key exists in the map or not. This is supposed to be easy, right? Yes, it is easy if you know your API well, all you need to is call the containsKey() method, it returns true if given key exists in HashMap, otherwise false; but I have seen many programmers write code like below which is not correct, which inspired me to write this blog post.

if(map.get(key) !=  null){
    System.out.println("key exits in Map");
}

This code is fragile, it will not work if you have added null values into HashMap because HashMap does allow null values.

5 Free Linux Courses for Programmers and IT Professionals to Learn Online

Linux is one of the most popular operating systems to run server-side applications. I have seen almost all Java applications running on Linux barring a couple of them which runs on Windows as service. If you take out standalone apps like IDEs or tools, most of the real world Java applications run on Linux e.g. payment gateways, trading systems, and other financial applications. That's why it's very important for any programmer, IT professional, or a developer to learn and understand Linux, both operating system, as well as command line.

Top 10 REST API and RESTful Web Services Book for Java Web Developers

In recent years, REST has become the standard style for developing web services, also known as RESTful Web Services. These web services take advantage of REST principles, which leverages all goodness of HTTP to provide scalable and robust web services. As a Java Web developer, it's high time that you get familiar with the REST concepts and the REST style of developing web services in Java, also known as RESTful web services and nothing is better than to start with a good book. I often receive a request about which book should I read to learn REST? or what are some best books to learn to develop RESTful Web services in Java etc? In this article, I will suggest some books which will teach you both designing a REST API and developing RESTful web services in Java.

How to implement Radix Sort in Java - Algorithm Example

The Radix sort, like counting sort and bucket sort, is an integer based algorithm (I mean the values of the input array are assumed to be integers). Hence radix sort is among the fastest sorting algorithms around, in theory. It is also one of the few O(n) or linear time sorting algorithm along with the Bucket and Counting sort. The particular distinction for radix sort is that it creates a bucket for each cipher (i.e. digit); as such, similar to bucket sort, each bucket in radix sort must be a growable list that may admit different keys.

Top 10 Data Science and Machine Learning Certification Courses to Learn Online - Best of Lot

If you work in the technology field today like you are a programmer or software engineer then I am sure you have heard about terms like Data Science, Machine Learning, Deep Learning, Artificial Intelligence etc. They are the latest technologies which are impacting every single sector just like IT does it when it comes the first time. It doesn't matter if you are working for a bank or insurance sector, airspace or defense, all fields were impacted by IT and in near future, they will be impacted by machine learning and artificial intelligence. If you are wondering, let me give you a brief overview. Machine learning is all about training machines to do the job which was only possible by humans before, for example seeing a photo and recognizing what is the object like a car, a human or a cucumber.

How to Convert/Print Array as String in Java with Example

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 String, you will get something like I@4fee225 due to the default implementation of 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.

How to convert Stream to List, Set, Map, and ConcurrentHashMap in Java 8 - Learn with Examples

In Java 8, Stream is one of the most important class as it allows a lot of useful functional operations e.g. filter, map, flatmap, etc on a collection of object. Hence, going forward converting a Collection to Stream, performing operations and then converting the result back to different Collection classes like List, Set, and Map will be a common task. The first problem of converting Stream to Collection is solved by Java designer by directly adding a stream() method on Collection interface, which means all other interfaces and classes which derived from Stream also have this method. Though the second problem of converting a Stream to List, Set, and Map requires some understanding of Stream API of JDK 8 and that's what you will learn in this article.