To compare two arrays in Javascript, there are various approaches we can use. We will be understanding various approaches in this article. When comparing two arrays, we cannot use “==” or “===” operator as it compares the addresses of the memory block to which both the arrays are pointing resulting in a false result. In this article we are having two arrays and our task is to compare two arrays in JavaScript. Approaches to Compare Arrays in JavaScript Here is a list of approaches to compare two arrays in JavaScript which we will be discussing in this article with stepwise ... Read More
Both Lumen and Laravel are frameworks used for backend web development. We will discuss what is Lumen, features of Lumen, advantages and disadvantages and applications of Lumen. Similarly we will discuss Laravel in this article. Then we will discuss differences between Lumen and Laravel.What is Lumen?Lumen is framework used for small project. It is micro-framework used in backend web development. We use PHP prorgamming language in Lumen. Lumen is lightweight version of Laravel. Lumen is a open-source framework. You can learn Lumen if you know PHP programming language. Features of LumenThese are various features of Lumen given as below -Composer: It uses Composer for dependency management. We ... Read More
Both Laravel and CodeIgniter are frameworks used to develop backend web development. Both frameworks use PHP programming languages. We will discuss what is Laravel, features of Laravel, advantages and disadvantages and applications of Laravel. Similarly, we will discuss CodeIgniter in this article. Then we will differences between Laravel and CodeIgniter. What is Laravel?Laravel is a framework used in backend web development using PHP programming language. Laravel is a open-source framework with model-view-controller design pattern. Laravel reuses existing components of different frameworks. Laravel provides a rich set of functionalities and features. You can learn Laravel framework easily if you know basic and advanced PHP. A ... Read More
This example demonstrates how to change the color and font of Android ListView using Kotlin. Step 1 − Create a new project in Android Studio, go to File? New Project and fill all required details to create a new project. Step 2 − Add the following code to res/layout/activity_main.xml. Example Step 3 − Add the following code to src/MainActivity.kt import android.os.Bundle import android.widget.ArrayAdapter import android.widget.ListView import androidx.appcompat.app.AppCompatActivity class MainActivity : AppCompatActivity() { var operatingSystem: Array = arrayOf("Android", "IPhone", "WindowsMobile", "Blackberry", "WebOS", "Ubuntu", "Windows7", "Max OS X") override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) title = "KotlinApp" ... Read More
In this article, we will learn to find the common divisors of two numbers using Java. The program will use a recursive method to calculate the greatest common divisor (GCD) of the two numbers, and then determine how many divisors are shared by both numbers. The output will display the total number of common divisors. Problem Statement Write a Java program to find and count the common divisors of two given numbers. Below is a demonstration of the same − Input val_1= 68 val_2= 34 Output The common divisors between the two numbers is4 Steps to find the common divisors ... Read More
In this program, we will perform an iterative quick sort in Java to sort an array of integers. Instead of using recursion, the program uses an iterative approach with an auxiliary stack to manage the sorting process. The output will display the sorted array after applying the quick sort algorithm. Problem Statement Write a Java program to sort an array of integers using the iterative quick sort method. Below is the demonstration of the same − Input {34, 76, 41, 32, 11, 0, 91, 102, -11} Output After iteratively performing quick sort, the array is -11 0 11 32 34 ... Read More
The Fibonacci Series generates subsequent numbers by adding two previous numbers. The Fibonacci series starts from two numbers − F0 & F1. The initial values of F0 & F1 can be taken as 0, 1, or 1, 1 respectively. Fn = Fn-1 + Fn-2 Problem Statement Write a program in Java program to print a Fibonacci series. Input Run the program Output 1 1 2 3 5 8 13 21 34 55 The above output is obtained when the values of n=10. Different approaches to print a Fibonacci series Following are the different approaches to printing a Fibonacci series − ... Read More
In this article, we will learn about constructors in Java. Constructors initialize objects when they are created. We will also see how the parent constructor is called in inheritance. Problem StatementWe will demonstrate possible approaches to show how the inherited constructor calls the parent constructor by default.Different approaches The following are the different approaches to show how the inherited constructor calls the parent constructor by default− Demonstrating inheritance properties ... Read More
In this article, we calculate the number of minutes in a given duration using Java. The Duration class can perform time-based calculations like hours, minutes, days, etc.. and easily convert between these units. Using the toMinutes() method you will be able to get the number of minutes from a given Duration. Problem StatementGiven a Duration object representing a period of time, write a Java program to calculate the number of minutes in the specified duration.Input Duration = 25 days, 10 hoursOutput Minutes in 25 days = 36000Minutes in 10 hours = 600 Steps to get the number of ... Read More
In this article, we use the System.nanoTime() method in Java to get the current value of the system timer in nanoseconds. It returns the current value of the most precise available system timer, in nanoseconds. Problem StatementGiven that you need to get the current value of the system timer in nanoseconds, write a Java program that retrieves this value using the System.nanoTime() method.Input There is no specific input as the program retrieves the system's current time in nanoseconds directly.Output Current Value: 49908709882168 nanoseconds Steps to get the current value of the system timer in nanosecondsThe following are the ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP