
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7442 Articles for Java

696 Views
In this article, we will learn to take a character input from the user and convert it into a string using Java. The toString() method of the Character class converts the character to a string. Problem Statement Write a program in Java to convert a character to a string. Input Enter a character :: T Output T Steps to convert character to string Following are the steps to convert characters to the string − We will start by importing the Scanner class to handle user input using java.util package. After that, ask ... Read More

696 Views
In this article, we will learn to take a character input from the user and convert it into a string using Java. The toString() method of the Character class converts the character to a string. Problem Statement Write a program in Java to convert a character to a string. Input Enter a character :: T Output T Steps to convert character to string Following are the steps to convert characters to the string − We will start by importing the Scanner class to handle user input using java.util package. After that, ask ... Read More

39K+ Views
Percent means percent (hundreds), i.e., a ratio of the parts out of 100. The symbol of a percent is %. We generally count the percentage of marks obtained, return on investment etc. The percentage can go beyond 100% also.For Example, assuming that we have total and a part. So we say what part is what percent of total and should be calculated as −percentage = ( part / total ) × 100AlgorithmBelow is the algorithm to calculate percentage in Java:1. Collect values for part and total 2. Apply formula { percentage = ( part / total ) × 100 } ... Read More

39K+ Views
Percent means percent (hundreds), i.e., a ratio of the parts out of 100. The symbol of a percent is %. We generally count the percentage of marks obtained, return on investment etc. The percentage can go beyond 100% also.For Example, assuming that we have total and a part. So we say what part is what percent of total and should be calculated as −percentage = ( part / total ) × 100AlgorithmBelow is the algorithm to calculate percentage in Java:1. Collect values for part and total 2. Apply formula { percentage = ( part / total ) × 100 } ... Read More

6K+ Views
Mean is an average value of given set of numbers. It is calculated similarly to that of the average value. Adding all given number together and then dividing them by the total number of values produces mean.For Example Mean of 3, 5, 2, 7, 3 is (3 + 5 + 2 + 7 + 3) / 5 = 4AlgorithmTake an integer set A of n values.Add all values of A together.Divide result of Step 2 by n.The result is mean of A's values.Programpublic class CaculatingMean { public static void main(String args[]){ float mean; int ... Read More

6K+ Views
Mean is an average value of given set of numbers. It is calculated similarly to that of the average value. Adding all given number together and then dividing them by the total number of values produces mean.For Example Mean of 3, 5, 2, 7, 3 is (3 + 5 + 2 + 7 + 3) / 5 = 4AlgorithmTake an integer set A of n values.Add all values of A together.Divide result of Step 2 by n.The result is mean of A's values.Programpublic class CaculatingMean { public static void main(String args[]){ float mean; int ... Read More

18K+ Views
An average of a set of numbers is their sum divided by their quantity. It can be defined as −average = sum of all values / number of valuesHere we shall learn how to programmatically calculate average.Algorithm1. Collect integer values in an array A of size N. 2. Add all values of A. 3. Divide the output of Step 2 with N. 4. Display the output of Step 3 as average.ExampleLive Demopublic class AverageOfNNumbers { public static void main(String args[]){ int i,total; int a[] = {0,6,9,2,7}; int n = 5; total = 0; for(i=0; i

18K+ Views
An average of a set of numbers is their sum divided by their quantity. It can be defined as −average = sum of all values / number of valuesHere we shall learn how to programmatically calculate average.Algorithm1. Collect integer values in an array A of size N. 2. Add all values of A. 3. Divide the output of Step 2 with N. 4. Display the output of Step 3 as average.ExampleLive Demopublic class AverageOfNNumbers { public static void main(String args[]){ int i,total; int a[] = {0,6,9,2,7}; int n = 5; total = 0; for(i=0; i

2K+ Views
Following is an example to find the cube root of a given number.Programimport java.util.Scanner; public class FindingCubeRoot { public static void main(String args[]){ double i, precision = 0.000001; System.out.println("Enter a number ::"); Scanner sc = new Scanner(System.in); int num = sc.nextInt(); for(i = 1; (i*i*i)

2K+ Views
Following is an example to find the cube root of a given number.Programimport java.util.Scanner; public class FindingCubeRoot { public static void main(String args[]){ double i, precision = 0.000001; System.out.println("Enter a number ::"); Scanner sc = new Scanner(System.in); int num = sc.nextInt(); for(i = 1; (i*i*i)