How to use Queue Interface in Java? Example Tutorial

The JDK provides an implementation of several data structures in the Java collection framework like ArrayList is a dynamic array, LinkedList represents a linked list, HashMap represents a hash table data structure, and Queue interface represent queue data structure. Btw, If you are not familiar with data structure itself, then you can also see Introduction to Data Structures & Algorithms in Java, an excellent course to start with the essential data structure in Java. The Queue data structure allows you to process elements in the first in first out order, and that's why it is also known as a FIFO data structure. 

How to Convert Date to LocalDate in Java 8 - Example Tutorial

Hello guys, if you want to learn how to convert old Date to new LocalDate in Java 8 then you have come to the right place. Earlier, I have shared 10 examples of LocalDate in Java 8, and in this article, I am going to teach you how to convert Date to LocalDate in Java. you may know that JDK 8 introduced the new Date and Time API, which has got a new set of shiny date classes like LocalDate, LocalTime, etc, but you still have a lot of code written against java.util.Date? In order to work with that code, you should know how to convert java.util.Date to java.util.LocalDate in Java. 

10 Linux Books Every Programmer Should Read

Computer and Technology related books get outdated so fast. You might be better off getting a Linux magazine subscription. The fact that the basics rarely change would also help keep the texts relevant.


1) Understanding the Linux Kernel (Bovet & Cesati), 3rd Edition
This book talks about very specific data structures and OS algorithm implementations at they pertain to the 2.4 Linux kernel. Not sure what you are getting at. 3rd edition is 2006 ;)

2) Linux kernel development

3) Linux in a Nutshell - 1997

Linux, In a Nutshell, is great, see about getting more of the O'Reilly books if you want good reference books.

4) Linux Bible Paperback 8th Edition
by Christopher Negus (Author), Christine Bresnahan  (Contributor)

5) UNIX and Linux System Administration Handbook (4th Edition) Paperback – July 24, 2010
UNIX and Linux System Administration Handbook is an absolute must-have for any sysadmin or Linux systems engineer.

6) RHCSA/ RHCE Red Hat Linux Certification: Exams (Ex200 & Ex300) (Certification Press) Paperback – June 17, 2011
by Michael Jang (Author)

7) The Linux Programming Interface

The Linux Programming Interface: A Linux and UNIX System Programming Handbook (Michael Kerrisk) I've found The Linux Programming Interface to be one of the best in-depth books I've ever tried to read on Linux. Only issues with it are it's not too hands-on, so it's a bit difficult to retain, and maybe the price, bit would have to say it's still totally worth it. 

The only problem is its size, 1500+ pages might look intimidating, so use it on a need basis, more like a reference book. Instead of focusing on size, focus on what looks interesting, as this isn't the kind of book you read back-to-back and it's more helpful in using to figure out what you don't know you don't know.

8) Unix Shell Programming (3rd Edition), by Stephen Kochan (old bell labs employee)

9) The Linux Command-Line.
Have a look at The Linux Command-Line. The book focuses on novice users and the extended version is free for download.

10) Bash Guide, which I used to read
Books on bash would be useful as well since bash plays an important role in Linux.

That's all about some of the best book to learn Linux and Shell Programming.

3 Difference between multi-threading and multitasking? [Answered]

Hello guys, what is the difference between multithreading and multitasking is a common Java interview questions. If you are also wondering what it the real difference between them as they sound similar the continue reading this article and you will find the answer. In the programming world, there are two main ways to improve the throughput of a program,  by using multi-threading and by using multitasking. Both take advantage of parallelism to efficiently utilize the immense power of the CPU and improve the throughput of your program. Actually, multi-threading is nothing but thread-based multitasking. 

How to convert String to Date in Java? Example Tutorial

Hello guys, if you are wondering how to convert a String to Date object in Java then you have come to the right place. Data type conversion is one of the most common tasks in programming and every Java  programmer must know how to convert one type to another type. There are many times when you will be required to convert a String to LocalDate or java.util.Date object mostly in a different format like dd-MM-yy or yyyy-MM-dd or simply yyyy MM dd. For example, clients pass dates as String to the Server or sometimes we read Date related data from CSV file. Java provides API for parsing String to date using DateFormat class, though Java's Date and Time API is severely criticized, it is also the most used Date and Time format solution. 

What is difference between start and run method of Thread in Java? Answer

Hello guys, what is the difference between calling start() vs run() method in Java multithreading is a popular core Java interview questions and if you are wondering the subtle difference between two then you have come to the right place. In this article, I will answer this question and show you an example as well. If you remember, a Thread is started in Java by calling the start() method of java.lang.Thread class, but if you learn more you will find out that the start() method internally calls the run() method of the Runnable interface to execute the code specified in the run() method in a separate thread. 

Difference between Self and Equi Join in SQL - INNER Join example MySQL

The main difference between Self Join and Equi Join is that In Self Join we join one table to itself rather than joining two tables. Both Self Join and Equi Join are types of INNER Join in SQL, but there is a subtle difference between the two. Any INNER Join with equal as join predicate is known as Equi Join. SQL Joins are the fundamental concept of SQL similar to correlated and noncorrelated subqueries or using group by clause and a good understanding of various types of SQL join is a must for any programmer.

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

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

How to Convert a Stream to List, Set, and Map in Java? Example Tutorial

Hello guys, if you are wondering how to convert a Java Stream to Java Collections like List, Set and Map then you have come to the right place. Earlier, I have shared free Java Courses for beginners and in this article, I am going to share examples to convert Stream to ArrayList, LinkedList, HashSet, TreeSet, LinkedHashSet, TreeMap, HashMap, and ConcurrentHashMap in Java. These are easy-to-follow examples and suitable for both beginners and experienced Java programmers.  In Java 8, Stream is one of the most important classes as it allows a lot of useful functional operations like filter, map, flatmap, etc on a collection of objects. 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. 

Top 5 Practice Tests for Google Cloud Professional Cloud Architect Certification Exam

If you are looking for any exam courses to values your skills in the Google Cloud Professional Cloud Architect certification then you are in the right place. Clicking on this article link shows that you are very curious to study more about Google Cloud Professional Cloud Architect certification and as well as taking and succeed in the exam to get your Google Cloud Professional Cloud Architect certification.

How to send HTTP Request from a Java Program - Example Tutorial

If you are thinking is it possible to send an HTTP request from a Java program and if yes, how to send a simple HTTP GET request in Java, then you have come to the right place. In this article, I'll show you how you can use the HttpURLConnection class from the java.net package to send a simple HTTP request in Java. But, first, let me answer your first question, is it possible to send an HTTP request in Java? Yes, it's possible and you can send any kind of HTTP request like GET, POST, PUT, DELETE, HEAD, or PATCH. The java.net package provides a class called HttpURLConnection, which can be used to send any kind of HTTP or HTTPS request from Java program.

Difference between static initializer block vs instance initializers in Java? Example

In Java, you can initialize member variables or fields in the same line you declare, in the constructor, or inside an initializer block. There are two types of initializer blocks in Java, static initializer block to initialize static variables and instance initializer block to initialize non-static fields. As the name suggests, the main difference is their purpose, instance initializer block if for instance variables, and static initializer block is for static variables. Another key difference between them is the time of execution. 

How to validate phone numbers in Java? Google libphonenumber library Example Tutorial

Hello guys, if you are wondering how to validate if a given number or string is a valid phone number in a Java application then you are not alone. It's a common requirement to validate phone numbers for a Java web application, much like validating email addresses. Unfortunately, Java doesn't provide any built-in method to carry out this kind of common validation, I would love to have a validation package in Java, but don't worry there must be an open-source library to cover this deficiency, right? Yes, there is Google's phone number library which allows you to validate any phone number both international, USA specific, or any country-specific.

How to convert String to int or Integer data type in Java? Example Tutorial

Hello guys, if you are wondering how to convert a String variable to int or Integer variable in Java then you have come to the right place. Earlier, I have showed how to convert Integer to String in Java and today, you will learn about how to convert String to int or Integer variable in Java. There are 3 main ways to convert String to int in Java, first, by using the constructor of Integer class, second, by using parseInt() method of java.lang.Integer, and third, by using Integer.valueOf() method. Though all those methods return an instance of java.lang.Integer, which is a wrapper class for primitive int value, it's easy to convert Integer to int in Java. 

3 ways to Convert Integer to String in Java [Example]

Hello guys, this is the second part of the String to Integer data type conversion tutorial in Java, in the first part you have learned how to convert String to Integer, and in this article, you will learn the opposite i.e. convert from Integer to String. Actually, you can apply all the tricks, which I had told you before about converting long to String, and autoboxing will take care of converting int to Integer in Java. But, if you care for performance and believe in not using auto-boxing when not needed then there are still a couple of ways that directly converts an Integer object to a String like the Integer.toString() method, which returns a String object and doesn't have any auto-boxing overhead. Let's see a couple of more ways to convert an Integer to a String in Java.

Difference between private and final class, method, and variables in Java?

Hello guys, one of the common questions among Java beginners is what is the difference between a private and final keyword in Java? The confusion arises because they are very similar and used in a similar context. For example, you can make a class, a method, and variable final as well as private. Both put some kind of restriction like you cannot override a final method in Java and the private method is not even accessible outside the class, so obviously you cannot override it. 

What is InstanceOf keyword in Java [Example Tutorial]

The Java programming language and JVM are full of hidden gems and even though I am using Java for more than a decade I still get surprised by features that I didn't know for quite some time like shutdown hook, covariant method overriding, and JVM option to refresh DNS cache.  The instanceof operator is also one of the rarely known features of Java, It is used to check if an object is the instance of a particular class or not. It returns true if the object is an instance of the class, otherwise, returns false. You might have seen usages of the instanceof keyword in Java while overriding the equals() method. Since for checking equality of two instances, the first step is to verify whether they are the instance of the same object or not, you can use the instanceof operator there.

Difference between trustStore vs keyStore in Java SSL

If you are confused between truststore and keystore and looking to find what exactly they mean then you have come to the right place. Earlier, I have shared free Java courses and today, I am going to tell you the difference between trustStore and keyStore in Java. Both trustStore and keyStore are important but confusing concepts and constantly tormented Java developers when they connect to servers using SSL. The main difference between trustStore vs keyStore is that trustStore (as the name suggest) is used to store certificates from trusted Certificate authorities(CA) which are used to verify certificate presented by Server in SSL Connection while keyStore is used to store the private key and own identity certificate which program should present to other parties (Server or client) to verify its identity.

SQL Join Tutorial - How to use JOIN Multiple Tables in SQL query? MySQL Example

Hello guys, if you are wondering how to join multiple tables in SQL to produce a combine result which contains columns from all tables but not sure how to do it then you have come to the right place. SQL Join is one of the basic concepts while working in databases or tables but yet less understood and most confusing topic for beginners and even intermediate developers. I compare Joins in SQL with Recursion in programming in terms of confusion because I have found that these two topics are special in their nature and you can't get it right with casual reading until you understand the concept and its various well. Things get worse when the table locked due to such SQL Join queries which were fired without knowing how much time it would and how big the result set could be. 

Difference between Primary and Foreign keys in SQL [Answer]

The database is a collection of tables and a table is the collection of rows or records. A primary key is the data to uniquely identify a row in the table. For example, if an Employee table has millions of rows and emp_id is a primary key then it can uniquely identify that row. You can use this primary key to retrieve (SELECT) the row, update the row, and delete the row. In SQL, a table can have only one primary key but it can contain more than one column. There are two types of primary key, a simple primary key, and a composite primary key.

When to use TRUNCATE vs DELETE command in SQL?

While working with the database we often need to delete data, sometimes to create more space, sometimes just remove all data to make the table ready for the next day's transaction, or sometimes just selectively remove stale data. SQL provides a couple of handy commands to remove data e.g. truncate, delete and drop. The last one is a bit different because instead of removing data it just deletes the table. What is the difference between truncate and delete command in SQL or when to use truncate vs delete is one of the most frequently asked SQL interview questions?