Core java
- 22 January
Convert celsius to fahrenheit in java
In this tutorial, we will see simple java program to convert celsius to fahrenheit in java. You can convert celsius to fahrenheit using this formula. fh = (1.8*cen) + 32; [crayon-6742a1b46f5dd936625084/] Output: Enter Temperature in Centigrade : 30 Equivalent Temperature in Fahrenheit = 86.0
- 22 January
Convert fahrenheit to celsius in java
In this tutorial, we will see simple java program to convert fahrenheit to celsius in java. You can convert fahrenheit to celsius using this formula. cel = (fh-32) / 1.8; [crayon-6742a1b46f814345554863/] Output: Enter Temperature in Fahrenheit : 79 Equivalent Temperature in Celsius : 26.11111111111111
- 20 January
Java program to delete words from sentence
In this post, we will see how to delete words from the sentence. You can just use String’s replaceAll method to replace the word with empty String(""). Here is simple java program to delete words from the sentence. [crayon-6742a1b46f8b0130142315/] Output: Enter a String : Java2Blog is a technical blog. Enter a Word you want to […]
- 20 January
Java program to remove vowels from String
In this tutorial we will see how to remove vowels from String in java. Using replaceAll() method We will use String’s replaceAll() method to remove vowels from String. [crayon-6742a1b46f95c264287032/] Output: Enter a String : Java2Blog All Vowels Removed Successfully..!! New String is : Jv2Blg Explaination Take input String from Scanner str1 Call replaceAll() method on […]
- 20 January
Java program to calculate arithmetic mean
In this tutorial, we will see simple java program to calculate arithmetic mean. Here is simple algorithm to calculate arithmetic mean. Calculate sum of elements in the array Divide it by total number of element in the array. [crayon-6742a1b46fa0d476109621/] Output: Please enter count of numbers you want to Enter ? 5 Enter 5 Numbers : […]
- 20 January
Java program to count positive, zero and negative numbers
In this post, we will see Java program to count positive, zero and negative numbers [crayon-6742a1b46fa8e541691120/] Output: Enter 10 Numbers : 10 0 45 -10 67 0 76 -33 64 -92 5 Positive Numbers 3 Negative Numbers 2 Zero That’s all about Java program to count positive, zero and negative numbers
- 20 January
Program to find frequency of characters in a string in java
In this tutorial, we will see simple program to find frequency of characters in a string in java. There are multiple ways to solve this proble. Let’s see one by one. Using counter array Here is the algorithm for the same. Initialize counter array of 256 length Iterate over String and increase count by 1 […]
- 20 January
Java program to count number of words in sentence
In this tutorial, we will see a simple java program to count number of words in sentence. [crayon-6742a1b46fc7f946881036/] Output: Enter a Sentence : Java2Blog is a technical blog. Total number of words are 5 That’s all about Java program to count number of words in sentence.
- 20 January
Java program to print Diamond pattern
In this tutorial, we will see java program to print diamond pattern. [crayon-6742a1b46fd0b631337630/] That’s all about printing diamond pattern in java.