Sunday , January 22 2017
Home / JAVA

JAVA

Java program to implement polymorphism

Java program to implement polymorphism: Polymorphism is a technique in java with which you can create multiple functions with same name but each having different arguments. It means that we have a program in which we have several functions with same name but have different arguments which are easy to use as if we put different names to the functions ...

Read More »

Program to check Upper Triangular matrix

What is Upper Triangular Matrix?  An upper triangular matrix is a square matrix in which all the elements below the diagonal are zero. We consider a Matrix U with ‘i’ rows and ‘j’ columns, then mathematically we represent the upper triangular matrix as In another word strictly upper triangular matrix is an upper triangular matrix having 0’s along the diagonal ...

Read More »

Java Program to find Mobius Function of number

Mobius Function Java Program:  The MOBIUS function µ(n) for a natural number N is defined as follows: µ(n) = 1 if n is a square free positive integer with an even number of prime factors. µ(n) = 0 if n has a squared prime factor. µ(n) = -1 if n is a square free positive integer with an odd number of ...

Read More »

Program for Matrix Multiplication in JAVA

Matrix Multiplication:– Here is given a Java Program for Matrix Multiplication also call matrix product. In other words, Let the two matrix to be multiplied be A and B. Let A is an n × m order matrix and B is an m × p order matrix, their matrix product A*B is an n × p order matrix, in which the m ...

Read More »

Program for Fascinating Number in JAVA

Fascinating Number :- The number of 3 digit or more, when we multiplied that number by 2 and 3, and product of both is concatenated with the original number, after concatenated the number contain all the digits from 1 to 9 exactly once, regardless of the number of zeros. Example: Consider a number 327 327*1=327 327*2=654 327*3=981 Concatenating all result: ...

Read More »

JAVA program to check Anagram of a Words

Program in Java to Check if the word is a anagram of a given word: An anagram is a type of word play, the result of rearranging the letters of a word to produce a new word or we can say the possible string we make by rearranging the letter of word. Example: Anagram of the word ‘ABC’ are : ABC, ...

Read More »

JAVA program to calculate digit sum of an integer

The digit sum of a given integer number is the sum of all its individual digits. Java Source code to calculate sum of digits of a number is given with example and detailed explanation. The sum of the digits of a number are calculated or used in many further programs. Digit Sum Example:- Iteration 1 : 1894%10 = 4 1894/10= 189 value ...

Read More »

Binary Search Program in Java

Binary search Program with Example:-  A binary search locates an item in a sorted array by repeatedly dividing the search interval in half. Initially interval include the whole array. If the value of the search key is less than the item in the middle of the interval, narrow the interval to the lower half. Otherwise narrow it to the upper ...

Read More »

Java Program to find Anagrams Words

Anagrams Program in Java: Anagrams means different combination, the result of rearranging the letters of a word to produce new words or we can say the possible string we make by rearranging the letter of word. Anagrams of a word is to get all the permutation of a word. Here we have provided a simple anagram code in Java and there are ...

Read More »

Harshad Number Program in Java (Niven Numbers)

Java Program to check for Harshad Number:  What is a Harshad Number? Harshad Number also called Niven Number is a number that is divisible by the sum of its digits. Example: Number 200 is a Harshad Number because sum of digits 2 and 0 and 0 is 2(2+0+0) and 200 is divisible by 2. Number 171 is a Harshad Number because ...

Read More »