HTML

Java String 101 - Everything You Want to Know about String in Java

someone might question that why do we need another article about string in Java, haven't we had enough about the string is already written? Yes, I agree there are a lot of articles related to Java string covering topics like how to use Java String, an example of Java string and almost everything you can do with string in Java. But, I wanted to document my experience of using String in Java and some nasty and little-known things I discovered about the Java String class, which may not be obvious to many Java developers. A string is available in almost every programming language and its probably the most used data structure or a data type, hence a good knowledge of String is very important for every Java developers.

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.

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 smoother 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.

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.

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

It's a long time since Java 8 was released and there are so many Java 8 tutorials are written by Oracle, bloggers, and other peoples, but which should you read? Which tutorials are worth of your time? Actually, this question is asked to me by one of my reader called John, he was asking me about some good Java 8 tutorials, which he can read to start with. This encouraged me to take a look at some of the Java 8 tutorials available on the internet and form a list of best. I have just used three criteria, content, language, and length. Because tutorials complement books, they should not be like the book. They should be small enough to complete in a few hours and complete enough to give useful information. I also like tutorials, which discusses practical problems and examples.

50+ Basic Core Java Interview Questions with Hints and Answers

If you are preparing for your next Core Java interview and looking for some common question to practice or check your knowledge, then you have come to the right place. In this article, I'll share 50 Core Java Interview Questions from various companies. I have already discussed the answers to these questions in this blog or Javarevisited, so I have just put the link. First, you should try to answer it yourself and if you cannot then go to the link and find the answer. You can also compare your answer with mine and learn a few things here and there. In most of my interview post, I have also shared some common techniques to drive interview towards your comfort zone and how to leave a long-lasting impression on the interviewer, you can use those techniques to do well on your Java interviews.

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.

Top 5 Java EE Bad Practices Java Developers should Avoid

Here are some of the bad coding practices you should avoid while working for a Java EE application or Java Web application in general, which runs on a Web Server like Tomcat or Enterprise Server like JBoss, WebLogic, or IBM WebSphere:

1) Calling System.exit() from a Web application
It is never a good idea for a web application to attempt to shut down the application container. A call to System.exit() is probably part of leftover debug code or code imported from a non-J2EE application. You can further read my article "Don't use System.exit() on Java web application" to learn more about.

Top 5 Spring Boot Annotations with Examples for Java Developers

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

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.

How to print all leaf nodes of a Binary Tree in Java without Recursion

In the last article, you have learned how to print all leaf nodes of a binary tree in Java by using Recursion, a useful technique to solve binary tree problems and in this article, we'll answer the same question without using Recursion. Why should we do this? Well, it's a typical pattern on a programming job interview to solve the same problem using both Recursion and Iteration. Since some questions are easy to solve using recursion like linked list problems, binary tree-based problems, tower of Hanoi, or Fibonacci series but their non-recursive solution is comparatively tricky, interviewer test candidates against this shift in the algorithm.

How to Pass Spring Professional 5.0 Certification in 2019

Hello guys, if you have been self-preparing for Spring Professional 5.0 exam then you might have struggled with which topics to prepare and which topics to leave out. I often receive questions like does Spring Boot is part of Core Spring certification? Will there be any questions from Spring Security and Spring Data? Does Spring Cloud also part of this exam or not? Unfortunately, there is no detailed, semester like a syllabus for Pivotal's Core Spring certification. The only information which is available is on their exam brief pdf which lists the purpose of the exam and essential topics and their percentage breakdown in terms of their weight in the actual exam. Since the Spring framework is vast and it's very difficult to prepare, a good understanding of what is required and what is not is very important.

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.

How to Rotate an Array to Left/Right by a Given Number in Java - Coding Problem

Hello guys, welcome to this post with another array-based coding problem. In the last article, we've learned about finding missing numbers in the array with duplicates and today we'll solve the problem of rotating an array by left or right by a given number. For example, suppose an integer array {1, 2, 3} is given and it was asked to rate this array to the left by 3 then the result array will look like {2, 3, 1} because it was rotated twice on left. Similarly, if you are asked to rotate the same array twice by right then you'll get {1, 2, 3}, the same array is back. This is an interesting problem and it's quite easy to solve but I have seen many programmers struggle with this one as well. So, a little bit of practice and learning will not hurt.

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.

3 Ways to change Embedded Tomcat Server Port in Spring Boot Application

If you know Spring Boot really simplifies the web development by embedding essential libraries as well as a tomcat server to run Java web application. By default, this tomcat server listens on port 4588 and by any reason if you want to change than Spring boot provides several configuration options to achieve that. For example, I wanted tomcat to listen on port 8080 because port 80 is forwarded to 8080 in our Linux machine and we wanted our clients to provide our client with a clean URL without a port.

What is 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.

Top 5 Free jQuery Online Training Courses for Web Developers - Best of Lot

Hello guys, if you are thinking to learn jQuery and looking for some awesome free resources e.g. books, tutorials, and online courses then you have come to the right place. In this article, I am going to share some of the best free jQuery courses from Udemy and Pluarlsight which you can take to learn this awesome JavaScript library. In the past, I have also shared some free books and tutorials on jQuery, which complements these courses. You can also take a look at then while learning different parts of jQuery.  Before I share these free courses, let me brief you about what jQuery is and why you should learn it? Well, jQuery is a JavaScript library but unlike any other library it is very powerful and makes the client side scripting really easy.

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.

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

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

Top 5 Spring Security Online Training Courses for Java Developers

Security is one of the most important aspects of a modern web application, be it a Java web application, .NET or writing using any other web technology. In the Java world, Spring Security rule the security space. It's one of the rare frameworks which provided many security features e.g. authentication, authorization, session management, remember me and several other useful features out-of-the-box. Since there was no competition to Spring security and it does its job very well, it soon becomes the de-facto standard for implementing security in both Java web applications, REST APIs and core Java applications. The rise of the Spring framework certainly helps it to cement its place as well.

Top 50 Java Generics and Collection Interview Questions

Java Collection and Generic are a very important topic for Java Interviews. They also present some of the hardest questions to a programmer when it comes to interviews, especially Generics. It's not easy to first understand what a particular piece of code doing with those question mark and other signs and then the pressure of interviews also makes it hard to answer complex usage of Generics.  But, with proper preparation and paying attention to both Java Collection and Generic, you can solve that hurdle. If you are looking for Java job but hasn't done well in the interviews you have given so far then you have come to the right place. In this blog, I have shared a lot of Java interview questions on various topics and difficulty levels.

How to declare and Initialize two dimensional Array in Java with Example

An array of more than one dimension is known as a multi-dimensional array. Two of the most common examples of multi-dimensional arrays are two and three-dimensional array, known as 2D and 3D array, anything above is rare. I have never seen 4-dimensional arrays, even 3D arrays are not that common. Now the question comes when do use a multi-dimensional array? Any real-life example? Well, 2D arrays are very common on platform games like Super Mario Bros to represent screen or terrain; 2D arrays can also be used to represent structures like a spreadsheet, or to draw board games like Chess, which requires 8x8 board, Checkers and  Tic-Tac-Toe, which requires 3 rows and 3 columns.

Top 10 Data Science and Machine Learning Certification Online Courses from Udemy, Coursera and Pluralsight - 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 find Nth Fibonacci Number in Java - Coding Problem with Solution

It's been a long time since I have discussed a coding problem in this blog. So, I am going to start with the probably the oldest one of them, how do you find the nth number in a Fibonacci sequence? or how do you find the Fibonacci number in Java? or maybe printing the Fibonacci series. If you are a regular reader of this blog then you might know that I have already discussed both recursive and iterative algorithm for printing Fibonacci series but never really discussed especially writing a program to return the Nth Fibonacci number in Java. Don't worry the wait is over as in this article, we'll solve this common problem and learn a bit more about problem-solving, recursion, iteration and some basic algorithm skills.

12 Must Read Advance Java Books for Intermediate Programmers - Part 1

I often receive loads of email about Java books and courses recommendations, something like, I have 2 years of experience in Java and Spring, which Java books should I read to become an expert Java programmer, or I have 5 years of experience in core Java and want to become a Java expert, which books or courses should I refer? These are just some of the examples but most of the requests are like that. It's interesting that most of the email I receive is not from beginners, I mean those who want to learn Java from scratch, but, from Java developers who have 2 to 3 years of experience. I call them Intermediate Java programmers because they are in the state of their career where they know how to program in Java but they are not expert yet.

Top 5 Courses to learn Java 9, 10, 11 and 12 in 2019 - Best of Lot

Hello guys, even though Java 12 is around the corner, many developers are still on Java 8 and not really caught up with changes on Java 9, 10 or 11. If you are also on the same boat and want to start with Java 9 features then you have come to the right place. In this article, I am going to share some of the best online courses to learn changes in Java 9, 10, 11. These JDK releases are packed with some powerful features e.g. modules, API enhancements e.g. factory methods for an immutable list, set, and map, some changes on stream API and optional class, new features on process API etc. Since it's always good to keep yourself up-to-date, its time to spend some time to learn those new features and make use of them to write better code in Java.

Top 10 Algorithm books Every Programmer Should Read

Algorithms are language agnostic and any programmer worth their salt should be able to convert them to code in their programming language of choice. Unfortunately, I have come across several programmers who are REALLY good on programming languages like Java or Python like knows minor details of API and language intricacies but has very poor knowledge of fundamentals Algorithms and Data Structure. Just ask them to implement any popular sorting algorithms like quicksort or merge sort and they will fall apart. If you expect them to know more advanced and complex algorithms like String processing algorithms, graph algorithms, tree traversal or greedy algorithms, be ready to check on Interviews, otherwise, you might end up with some surprises.

Difference between OCAJP7, OCAJP8, and OCAJP11 Certification - 1Z0-803 vs 1Z0-808 vs 1Z0-815

One of the frequently asked questions asked by most of the OCAJP certification candidates is, what are the differences between OCAJP 8 and OCAJP 7? And, after Java 11 certification release, what is the difference between OCAJP 11 (1Z0-815) and OCAJP 8 (1Z0-808) Which one Java developers should go for? OCAJP7 or OCAJP8, or OCAJP 11? The obvious answer to this question is the latest Java version of the exam, I mean OCAJP 11. Since it's already more than a couple of months since Java 12 is out but there is no OCAJP 9 certification, the OCAJP 8 should be the exam, Java developer should pursue this year and beyond. The question is more for those who are looking to become certified Java developer in quick time and doesn't know Java 8 yet like experienced Java developers who have extensively worked in Java SE 6 and prior version but don't have any Java certification yet.

Java - Variable and Method Hiding Example

If Java, if you are not careful you can possibly hide both methods and variables of the superclass. A field or variable is said to hide all fields with the same name in superclasses. Similarly, a static method with the same name in a subclass can hide the method of the superclass. This can lead to subtle bugs, especially if you are expecting a different method to be called. In this article, I'll show you examples of both variable and method hiding in Java so that you can understand and avoid them in the future.

How to use Multiple Threads in Java - Example

Hello guys, Multithreading is one of the biggest strength of Java, which allows you to divide a task and execute faster by using more than one threads. In order to use multiple threads in Java, you need to first define the task which will be executed by those threads. In order to create those task, you can either use Runnable or Callable interface. If you are just learning Java chose the Runnable interface, it's simpler one, but if you are familiar with Java multithreading and want to leverage additional features offered by Callable like it can throw an exception and it can also return value, then go ahead and use the Callable interface. Once you have task ready, you need to create an instance of the Thread class.

10 Free Java 8 Certification Sample Questions - OCAJP8 and OCPJP8 - 1Z0-808 and 1Z09 dumps

If you are preparing for Oracle Java SE 8 Certifications e.g. OCAJP8 and OCJP8, also known as exam 1Z0-808 and 1Z0-809 and looking for some free practice tests then you have come to the right place. In this article, I am going to share some of the best OCAJP 8 and OCPJP 8 mock tests available for free of cost online, so that you can check your speed and accuracy before the real exam. These tests are not just useful for Oracle's Java OCA and OCP certification but also for upgrade exams like OCJP 8 upgrade exams with code 1Z0-810 and 1Z0-813, upgrade to Java SE 8 from Java 6 and prior version. Many of these practice tests are like web simulator where you need to solve a relatively small number of questions within 45 to 60 minutes. The web simulator also includes timer so that you can finish these free mock tests on time.

Post Order Traversal in Java Without Recursion - Example Tutorial

In the last article, I have shown you how to implement post-order traversal in a binary tree using recursion and today I am going to teach you about post order traversal without recursion. To be honest, the iterative algorithm of post-order traversal is the toughest among the iterative pre-order and in-order traversal algorithm. The process of post-order traversal remains the same but the algorithm to achieve that effect is different. Since post-order traversal is a depth-first algorithm, you have to go deep before you go wide. I mean, the left subtree is visited first, followed by right subtree and finally the value of a node is printed. This is the reason why the value of root is printed last in the post-order traversal algorithm.

Binary tree InOrder traversal in Java using Recursion

The InOrder traversal is one of the three popular ways to traverse a binary tree data structure, other two being the preOrder and postOrder. During the in order traversal algorithm, left subtree is explored first, followed by root, and finally nodes on right subtree. You start traversal from root then goes to left node, then again goes to left node until you reach a leaf node. At that point in time, you print the value of the node or mark it visited and moves to right subtree. Continuing the same algorithm until all nodes of the binary tree are visited. The InOrder traversal is also known as left-node-right or left-root-right traversal or LNR traversal algorithm.

5 Things You can Gift to Programmers,Software Developers and Tech Geeks

So, its that time of the year again when you start thinking about gifts for your programmer boyfriend, husband, colleagues or your near dear ones. Even if selecting gifts were not tough, if your friend happened to be a programmer, it becomes slightly tougher. You might have heard that Programmers are aloof, nerd and tech freaks, well, you heard it right. Programmers  prefers to be alone in their own world but they also like gifts and you got it right, they are a nerd so they like books, gadgets, music and something which help them to learn something e.g. a PluralSight membership.

In 2017, gadgets like Apple Watch and Samsung Gear is rocking but that's what everyone is buying so if you want to be a little bit different, chose the one from this list.

Top 5 Free Spring Core Professional Certification Practice Questions and Online Mock Exams

Many Java developers don't know that similar to Oracle's Java certification, there is also a Spring certification program, which certifies yourself for your Spring framework skill. There are three Spring certifications currently available, Spring Professional certification exam, which certifies on your general knowledge about Spring framework, Spring Web Application Developer exam, which certifies you about your Spring MVC skill and Spring Enterprise Integration Specialist certification exam, which is for advanced Spring Integration skill. Earlier, SpringSource provides these certifications but now they are provided by Pivotal, the company behind the Spring framework.

Top 5 Free R Programming Courses for Data Scientists and ML Programmers

More and more people are learning R programming language to become a Data Scientist, one of the hottest and high paying technical jobs on the planet. Though, I am from Python camp when it comes on choosing between Python and R for Data Science, Machine Learning, and Artificial Intelligence, mainly because of the awesome libraries Python offers, I had tried R for a short time. If you are also on the same boat and want to try or learn R programming for Data Science and machine learning purpose and looking for some awesome free courses to start your journey then you can take some ideas from this article.

Top 5 Free JavaScript Online Training Courses for Web Developers - Best of Lot

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

Post order traversal Algorithms for Binary Tree in Java with example

In the last couple of articles, you have learned about pre-order and in-order tree traversal algorithms in Java and today, you will learn about the post order traversal in a binary tree. It is the toughest of all three tree traversal algorithms and programmers generally struggle to implement this when asked in a coding interview, hence it makes sense to understand and practice this algorithm before going for the interview. The post order traversal is also a depth-first algorithm because you go deep before you visit other nodes on the same level. In post order traversal, you first visit the left subtree, then right subtree and finally you print the value of node or root. That's why the value of root is always printed last on post-order traversal. Like many tree algorithms, the easiest way to implement post-order traversal is by using recursion.

Can you join two unrelated tables in SQL? Cross Join Example

In one of the recent programming job interview, one of my readers was asked the question, how do you join two tables which are not related to each other? i.e. they don't have any common column? is it possible in SQL? My reader got confused because he only knows about INNER join and OUTER join which require a key column like dept_id which is the primary key in one table like Department and foreign key in another table like Employee. He couldn't answer the question, though he did tell them about you can select data from multiple tables by typing multiple table names in from clause using a comma. What he was saying was right, but he didn't know much about it, so he couldn't explain it confidently. Lucky for him, he got the job but he emailed me asking the same question which inspired me to write this post.

How to Print all leaf Nodes of a Binary tree in Java - Coding Interview Questions

This is another interesting coding problem which is based on a binary tree and mostly asked beginner programmers. If you have some experience in solving binary tree based problems then it's rather easy to solve because, like many other binary tree algorithms, you can use recursion to print all leaf nodes of a binary tree in Java. Since the tree is a recursive data structure, you can apply the same algorithm to both the left and right subtree. In order to solve this problem, the first thing you should know is what is a leaf node because if you don't know that then you won't be able to solve the problem. Well, a leaf node is the one who's left and right child nodes are null.

6 Data Structures Every Java Programmer Should Know

Java API provides built-in support for common data structures, essential for writing programs e.g. array, linked list, map, set, stack and queue. You don't need to implement these data structure by yourself, you can directly use it in your program, thanks to rich and efficient implementation provided by Java API. This is also one reason, why Java is the best programming language. Since data structure is core to any program and choice of a particular data structure greatly affects both functionality and performance of Java applications, it's worth an effort to explore different data structure available in Java.