How to convert array to JSON in Java? Example Tutorial

Before converting an array to Json. It is good to have a good understanding of an array and what JSon is.  

What then is an Array? An array is a data structure in java that holds values of the same type with its length specified right from creation time. Or you can say an array is a collection of similar type of elements which has contiguous memory location.

Oftentimes you may have to work on a task whereby you will have to store a large number of values during the execution of a program. for instance, you need to read 50 numbers, calculate their average, and find out how many numbers are above the average, and how many numbers are below average.

How to remove a specific item from an array in JavaScript? Example Tutorial

Provided you have an array and you need to remove a specific item, how would you go about it? no worries, there are many ways to kill a bird. So, in JavaScript, there are different methods and techniques you can use to remove element(s) from an array(s). For example, you can use the pop() method to remove the last element of a given array, or you can use the shift() method to remove the first element of a given array. You also have a splice() method which can remove multiple elements from the given array. If you are wondering how to use them then don't worry, you will see examples of all those methods in this article. 

How to append an element to an array in JavaScript? Example Tutorial

Appending means adding an element at the end of the array and before we do that, we need to have a good understanding of an array in javaScript.  What is an array? An array is a single variable that is used to store different elements. This means that JavaScript array(s) can hold different types of data like the number, string, boolean and object values at the same time. Unlike in Java, sorry You can’t do that. It is strongly typed in fact from creation time you would specify what type of data is coming in and its length. And you can’t do otherwise once you have stated the type of data and length any attempts to do that leads to compilation error.

How to remove empty elements in JavaScript array? Example Tutorial

Hello guys, if you are wondering how to remove empty elements from the JavaScript array then you have come to the right place. I have been sharing a lot of Javascript articles lately and this is the new one in the series. In the past, I have shared the best JavaScript courses, books, websites, and Javascript interview questions, along with many JavaScript and React tutorials, and today, we are going to see an example of removing empty elements from the Javascript array.  Actually, there are several ways of removing empty element(s) in javaScript. Removing empty elements connotes that there may be other elements too, and that should make you think of an array. 

How to loop through an array in JavaScript? Example Tutorial

There are several ways of traversing an array in JavaScript. But, before we delve fully into that we need to understand what an array is in JavaScript.

What then is an Array in JavaScript?

An array is a single variable that is used to store different elements. This means that JavaScript array(s) can hold different types of data like the number, string, boolean and object values at the same time.

10 Essential JVM Options for Production Java Applications

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

How to Schedule Spring Professional Certification Exam (VMware EDU-1202) Online? [Guide]

Hello folks, even since Pivotal made the mandatory training optional for Spring certification, I have been writing a lot about Spring 5.0 Core Professional exam here. In the past, I have written about general preparation tips, books, coursesmock tests. So, after months of hard work and preparation, you are finally ready for the day. In order to schedule for the Spring certification exam, you first need to buy an exam voucher from Vmware's website. If you have taken their training course like the Core Spring training course, then you also receive a free voucher for 1 attempt.

Top 13 Free Java 8 Certification Sample Questions - OCAJP8 and OCPJP8 - 1Z0-808 and 1Z0-809 Exam Dumps

Hello guys, Java SE 11 certifications are already out but not many people are not going for it because of the difficulty level. If you want to become a certified Java developer then Java SE 8 is still the best possible option. If you are preparing for Oracle Java SE 8 Certifications, like OCAJP8 and OCJP8, also known as exams 1Z0-808 and 1Z0-809, and looking for some free practice tests, then you have come to the right place. Earlier, I have shared the best Java certification courses, and 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. 

How to Implement Double Checked Locking Singleton Pattern in Java? Example Tutorial

Double-checked locking pattern is one of the interesting topics in Java Interviews. Earlier, it was asked to see if a Java developer can write code using a synchronized block or not, and now it asks to gauge the candidate's understanding of concurrency, volatile, and synchronization in Java. One of the simplest ways to write thread-safe Singleton was to make the getInstance() method synchronized but prior to JDK 1.6, a simple uncontented synchronization block was expensive, and that lead many developers to write the getInstance() method of the Singleton class using double-checked locking idiom

Java Serialization Example and Tutorial for Beginners [Guide]

Serializing an object in Java is never easy and many Java developers often get confused. There are so many rules, interfaces to implement, and then always a chance of data loss or an error during the Serialization or deserialization process.  In the past, I have posted a detailed guide of Serliazing Object in Java which is very liked by my readers and they asked for more information like what should Java developers remember while using the Serializable and Externalizable interface in Java. 

7 Difference between extends Thread vs implements Runnable in Java [Answer]

Hello guys, the difference between Thread vs Runnable in Java is a common Java multithreading interview question that is often asked by junior Java developers with 2 to 4 years of experience. If you are doing Java programming then you may know that Java provides multithreading to parallelize the execution of tasks (code) and you need multiple threads to run multiple things in parallel like downloading a file in the background and showing the progress bar at the front-end. There are two ways to create a Thread in Java, first by extending java.lang.Thread class and second by implementing the java.lang.Runnable interface. 

Difference between View and Materialized View in Database or SQL? [Answer]

The difference between View and Materialized view is one of the popular SQL interview questions, much like truncate vs delete, correlated vs noncorrelated subquery, or primary key vs unique key. This is one of the classic questions which keeps appearing in SQL interviews now and then and you simply can’t afford to learn about them. Doesn’t matter if you are a programmer, developer, or DBA, these SQL questions are common to all. Views are a concept which not every programmer is familiar with, it is simply not in the category of CRUD operation or database transactions or SELECT query, its little advanced concept for the average programmer.

How to find symbolic link or soft link in Linux? ls + find command Example Tutorial

There are two ways you can find a symbolic link or soft link in UNIX based operating systems like Linux, Solaris, BSD, or IBM AIX. The first way is by using the ls command in UNIX which displays files, directories, and links in any directory and the other way is by using UNIX find command which has the ability to search any kind of file e.g. file, directory, or link. In this UNIX command tutorial, we will see examples of both of these UNIX commands for finding a soft link in any directory. If you are new to UNIX operating system and not familiar with the concept of the soft link and hard link, I would recommend getting a good hand on it, as it is one of the most powerful features of UNIX based system.

10 Examples of forEach() method in Java 8

From Java 8 onward, you can iterate over a List or any Collection without using any loop in Java. The new Stream class provides a forEach() method, which can be used to loop over all or selected elements of the list and map. The forEach() method provides several advantages over the traditional for loop e.g. you can execute it in parallel by just using a parallel Stream instead of a regular stream. Since you are operating on stream, it also allows you to filter and map elements. Once you are done with filtering and mapping, you can use forEach() to operate over them. You can even use the method reference and lambda expression inside the forEach() method, resulting in a more clear and concise code.

3 Ways to return different content types from Spring MVC Controller? @RequestMapping and ResponseEntity Example Tutorial

Hello guys, if you want to provide different types from a Controller in Spring MVC and wondering how to do that then you have come to the right place. In the past, I have shared the free Spring MVC courses, books, and interview questions and in this article, I am going to show you three ways to send different content types from Spring Controller. There are various content types for a controller and we are going to discuss them in this tutorial. So we are going to discuss how to interpret the data present in the request and response. JSON is one of the media formats that may be consumed/produced using this request-response architecture.

How to pause a Thread in Java? Thread.sleep and TimeUnit.sleep Example

There are multiple ways to pause or stop the execution of the currently running thread in Java, but putting the thread into a sleep state using the Thread.sleep() method is the right way to introduce a controlled pause. Some Java programmers would say, why not use the wait and notify? Using those methods just for pausing a thread is not a good coding practice in Java. Those are the tools for a conditional wait and they don't depend on time. A thread blocked using wait() will remain to wait until the condition on which it is waiting is changed. Yes, you can put timeout there but the purpose of the wait() method is different, they are designed for inter-thread communication in Java

10 Examples of ALTER Table Command in SQL

In this SQL tutorial, you will learn how to use ALTER command in the table on the database. ALTER command is mainly used to add, modify and drop columns, indexes, and constraints on the table in relational databases e.g. MySQL, Oracle, Sybase, and SQL Server.  Though ALTER is not part of classical CRUD operation but it’s one of the important DDL commands. One of the most frequent uses of ALTER command in SQL is adding and removing indexes to improve the performance of SQL SELECT queries.

5 Difference between Interface and Abstract class in Java? [Answer]

What is abstract class and interface in Java?
The difference between abstract class and interface in Java is one of the tricky Java interview questions and mostly appears in core Java interviews. It has become now even trickier after Java 8 introduced default methods and allowed interfaces to have both default and static methods. Even though both interface and abstract class are a way to achieve abstraction in Java, there are significant differences between them, which you will learn in this article. Some time interviewer also not just focuses on key differences between abstract class and interface in Java but he is also interested in some practical experience e.g. when to use interface in Java and when to use an abstract class in Java.

Top 100 Angular Interview Questions for 1 to 2 Years Experienced Developers

Angular is one of the popular JavaScript frameworks, I think most popular after jQuery, with the core goal of simplification. It allows building dynamic, single-page web apps (SPAs) using JavaScript and supports the Model View Controller (MVC) programming structure. It has been used widely and even big companies like Google, Virgin America, and HBO are using Angular to build their site. The demand for web developers is at an all-time high and there is a huge demand for developers who understand modern JavaScript frameworks like Angular, jQuery, Facebook's React JS, etc. Angular is an Open-source, front-end JavaScript framework which is developed by Google, it mainly competes with Facebook's ReactJS framework

OCMJEA 6 FAQs - Oracle Certified Master - Java EE 6 Enterprise Architect (1Z0-807, 1Z0-865 and 1Z0-866) - Frequently asked Questions

The OCMJEA (Oracle Certified Master Java EE Enterprise Architect) is one of the toughest Java certifications to crack, even for experienced Java developers. It requires architectural decision skills for the given business problem. Step 1 multiple-choice tests your skills by scenario-based business problems to choose the best design solution. The exam not only covers the Java EE platform but also tests your security, hardware architecture, and design pattern skills.