- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- 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 9314 Articles for Object Oriented Programming
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
151 Views
To get the arc cosine of a given value in Java, we use the java.lang.Math.acos() method. The acos() method accepts a double value whose angle needs to be computed. The range of the angle returned lies in the range 0 to pi. If the argument is NaN or greater than 1 or less than -1 then the result is NaN.Declaration −The java.lang.Math.acos() method is declared as follows −public static double acos(double a)Here, a is the value whose arc cosine is computed.Let us see a program to get the arc cosine of a given value in Java.Example Live Demoimport java.lang.Math; public class ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
110 Views
To get the arc tangent of a given value in Java, we use the java.lang.Math.atan() method. The atan() method accepts a double value whose angle needs to be computed. The range of the angle returned lies in the range -pi/2 to pi/2. If the argument is NaN, then the result is NaN.When the argument is zero, then the output is a zero with the same sign as the argument.Declaration −The java.lang.Math.atan() method is declared as follows −public static double atan(double a)where a is the value whose arc tangent is computed.Let us see a program to get the arc tangent of ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
3K+ Views
In order to generate Random float type numbers in Java, we use the nextFloat() method of the java.util.Random class. This returns the next random float value between 0.0 (inclusive) and 1.0 (exclusive) from the random generator sequence.Declaration −The java.util.Random.nextFloat() method is declared as follows −public float nextFloat()Let us see a program to generate random float type numbers in Java.Example Live Demoimport java.util.Random; public class Example { public static void main(String[] args) { Random rd = new Random(); // creating Random object System.out.println(rd.nextFloat()); // displaying a random float value between 0.0 and 1.0 } ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
153 Views
In order to get the hyperbolic tangent of a given value in Java, we use the java.lang.Math.tanh() method. The tanh() method accepts an argument in radians and returns the hyperbolic tan of the argument which acts as the angle.Declaration −The java.lang.Math.tanh() is declared as follows −public static double tanh(double x)where, x is the angle in radians.Let us see a program to get the hyperbolic tangent of a given value in Java.Example Live Demoimport java.lang.Math; public class Example { public static void main(String[] args) { // get two double numbers in degrees double x = ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
11K+ Views
In order to check if a String has only Unicode letters in Java, we use the isDigit() and charAt() methods with decision-making statements.The isLetter(int codePoint) method determines whether the specific character (Unicode codePoint) is a letter. It returns a boolean value, either true or false.Declaration −The java.lang.Character.isLetter() method is declared as follows −public static boolean isLetter(int codePoint)Here, the parameter codePoint represents the character to be checked.The charAt() method returns a character value at a given index. It belongs to the String class in Java. The index must be between 0 to length()-1.Declaration −The java.lang.String.charAt() method is declared as follows −public ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
6K+ Views
To check whether a String contains only unicode letters or digits in Java, we use the isLetterOrDigit() method and charAt() method with decision-making statements.The isLetterOrDigit(char ch) method determines whether the specific character (Unicode ch) is either a letter or a digit. It returns a boolean value, either true or false.Declaration −The java.lang.Character.isLetter() method is declared as follows −public static boolean isLetter(char ch)The charAt() method returns a character value at a given index. It belongs to the String class in Java. The index must be between 0 to length()-1.Declaration −The java.lang.String.charAt() method is declared as follows −public char charAt(int index)Let us ... Read More
![Ankith Reddy](https://www.tutorialspoint.com/assets/profiles/22328/profile/60_142162-1519038074.jpg)
958 Views
To get the base 10 logarithm of value in Java, we use the java.lang.Math.log10() method. This method returns the log of value to the base 10 in the form of a double. If a number is 10n, then the result is n. If the value passed is NaN or negative, the result is NaN. If the value passed is positive infinity, then the value returned is positive infinity. When the parameter is positive zero or negative zero, then negative infinity is returned.Declaration −The java.lang.Math.log10() method is declared as follows −public static double log10(double a)where a is a value whose base ... Read More
![Arjun Thakur](https://www.tutorialspoint.com/assets/profiles/13574/profile/60_74441-1560315595.jpg)
169 Views
In order to get the hyperbolic sine of a given value in Java, we use the java.lang.Math.sinh() method. The sinh() method accepts an argument in radians and returns the hyperbolic sine of the argument which acts as the angle.Declaration − The java.lang.Math.sinh() is declared as follows −public static double sinh(double x)where x is the angle in radians.Let us see a program to get the hyperbolic sine of a given value in Java.Example Live Demoimport java.lang.Math; public class Example { public static void main(String[] args) { // get two double numbers in degrees double x ... Read More
![Chandu yadav](https://www.tutorialspoint.com/assets/profiles/22330/profile/60_142811-1519038104.jpg)
139 Views
In order to get the hyperbolic cosine of a given value in Java, we use the java.lang.Math.cosh() method. The cosh() method accepts an argument in radians and returns the hyperbolic cosine of the argument which acts as the angle.Declaration − - The java.lang.Math.cosh() is declared as follows −public static double cosh(double x)where x is the angle in radians.Let us see a program to get the hyperbolic cosine of a given value in Java.Example Live Demoimport java.lang.Math; public class Example { public static void main(String[] args) { // get two double numbers in degrees double ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
8K+ Views
In order to round float and double numbers in Java, we use the java.lang.Math.round() method. The method accepts either double or float values and returns an integer value. It returns the closest integer to number. This is computed by adding ½ to the number and then flooring it.Declaration - The java.lang.Math.round() method is declared as follows −public static int round(float a) public static int round(double a)where a is the value to be rounded.Let us see a program where float and double numbers are rounded in Java.Example Live Demoimport java.lang.Math; public class Example { public static void main(String[] args) { ... Read More