tech Java Programs | 500+ Programs - Java Programming
Latest :

Java Programs

Java Program To Insert An Element In Array | Programs

Java program to insert an element in an array or at a specified position. We will discuss a couple of methods on how to insert an element in an array at a specified position. The compiler has been added so that you can execute the programs yourself, alongside suitable examples and sample outputs added. The following program has been added ...

Read More »

Java : Check if Two Strings Are Anagrams 2 Ways | Java Programs

This Java program is to check if two strings are anagrams. In this particular java anagram program to check two strings are anagram to each other or not, we will add suitable examples & sample output as well. This code is for finding an anagram of a string in another string using Java language. The problem here is to find ...

Read More »

Java Program to Calculate Entropy 2 Ways | Java Programs

Java program to calculate entropy in 5 ways. Entropy, in short, is the average level of information or uncertainty in a particular variable’s possibility of outcomes. Our problem statement here is, to write a code to find the entropy of a number of messages. For this, our required inputs are, the number of messages (n) and the probability of each ...

Read More »

Java : Check if an Array Contains a Given Number | Java Programs

Here is we have to check if an array contains a value Java Program. Along with that, we will provide you with suitable examples and sample output. This code is for checking whether a user-determined element is present in an array using Java language. The problem here is to check whether a given element is present in an array. Our ...

Read More »

Java Program to Find Additive Inverse | Java Programs

Finding Additive Inverse through a Java Program – This specific article expresses the code for finding the additive inverse Java Program of a number. The problem here is to find the additive inverse of a user-defined number. The additive inverse of a number a is the number that, when added to a, yields 0 (example: Additive Inverse of 2 is ...

Read More »

Java Program to Calculate Telephone Bill | Java Programs

Java program to calculate telephone bill, here is the detailed program. There are certain steps to be taken so that, we arrive at our desired solution. Our first step is to understand the problem completely and to also see if any constraints are mentioned. Then, we determined the inputs required as well as the expected output. Then, we plan on ...

Read More »

Armstrong Number In Java Program – 5 Simple Ways

Armstrong number in Java. Here we have written the code in four different ways standard, using for loop, recursion, while loop and also with different examples as like: between 100 and 999, between 1 to 1000 and between 1 to 500 with sample outputs and online execution tool embedded. What is Armstrong Number? A: An Armstrong number of three digits is an ...

Read More »

Java Program to Calculate Fractions – Addition, Subtraction, Multiplication

Java program to calculate the fractions of Addition, Subtraction, and Simple. If you have any doubts related to the code mentioned over here, leave a comment here. Simple Fraction Our problem statement here is to convert into fractions. To convert into fractions, we need a numerator and denominator. Therefore our inputs will be two double-type numbers i.e., numerator (n1) and ...

Read More »

Inverted Pyramid Star Pattern Java Program

Java program to print Inverted Pyramid star pattern program – We have written below the print/draw Inverted Pyramid asterisk/star pattern program in four different ways with sample example and output, check it out. At the end of the program, we have added compiler so that you can execute the below codes. Using For Loop Using While Loop Using Do While Loop Using For ...

Read More »

Java Program to Implement Calculator Using Switch Case | Java Programs

Before directly jumping into the solutions, it is advisable to follow a few steps before only to avoid confusion at a later stage. First, we need to understand the problem statement thoroughly. Then, we have to look for any constraints given in the problem. After this, we have to decide on our inputs followed by determining our expected output for ...

Read More »
tech