Jan 5, 2022

How to compare arrays in Java | Examples

In this post we will learn how to compare two arrays in java. But, before that we need to understand what comparing arrays really means. So without wasting more time  lets get started. 

  What is comparing arrays really means: The comparing arrays means comparing or we can say checking first array elements are same like another one or not. for example: If we have two arrays like we can say arr1[] or arr2[] here,

Dec 7, 2021

Length of an Array in Java | Java Program to find Length of an Array

In this article you will learn how to find array length in java. But, before learning how to find array length, you should know exactly array length means what.

In short array length means the limit of elements that array can hold. See in the below diagram we have stored 7 elements in array so length of this array is 7.

Nov 24, 2021

How to Print Arrays in Java | Java Program to Accept and Print Array Elements

In this article we are going to learn how to accept and print array elements in Java. 

How to print arrays in java: 

To print array elements we first need to accept it from user. In this post we will learn how to accept array elements from user dynamically and print it on the output screen. Simple java program to insert elements in array. 

How to Sort Arrays in Java

In this post we will learn how to write a  java program to sort array elements. How to sort arrays in java. Sorting array elements means storing or printing it in ascending or descending order. So let's see how to print given array elements in sorted manner.

Nov 22, 2021

Java Program to Print Square of Given Array Elements

In previous post we learnt how to print multiplication of given array elements. In this post we will learn how to print squares of given array elements. So let's get started... :)

Java Program to Print Multiplication of Given Array Elements

Java program to print multiplication of given array elements

In previous post we learnt how to print Sum of given array elements. In this post we will learn how to print multiplication of given array elements. 

Nov 21, 2021

Java Program to Print Sum of given Array Elements

In previous  post we learnt how to check given element is present in array or not. In this post we will learn how to print sum of given array elements. So let's get started... :)


  Step by step logic of the given program:


1. Accept array limit from user store it in variable say lim.

2. Accept elements from user. Run a for loop from 0 to arr.length-1 and store elements one by one in array:

Java Program to Check whether Given Element is Present in Array or not

In previous tutorial we learnt how to accept and print array elements. In this post we will learn is given element is present in array or not, Java program to check whether given element is present in array or not.

Oct 28, 2021

Factorial Program In Java

Factorial Program in Java:

Factorial of a number means the product of all positive descending integers. 
for example: If we want to calculate factorial of 5 then it will be written as 
5 x 4 x 3 x 2 x 1 = 120 . So 120 is the factorial of  5.
  

  Program to Print Factorial of a given number:

Oct 26, 2021

Fibonacci Series Program In Java

Fibonacci Series In Java:

The fibonacci series is a series where the next number is the sum of previous two numbers.  
for examples:  0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc

above you can see first two numbers of fibonacci series are 0 and 1.