Latest Version Already Passed
How do you convert a string to an integer in Java?
✔✔You can convert a string to an integer using `Integer.parseInt(String s)`.
What method is used to find the length of a string in Java?
✔✔The method used to find the length of a string is `String.length()`.
How do you generate a random number between 0 (inclusive) and 1 (exclusive) in Java?
✔✔You generate a random number using `Math.random()`.
What method would you use to compare two strings for equality in Java?
✔✔You use `String.equals(Object obj)` to compare two strings for equality.
How can you round a decimal number to the nearest whole number in Java?
✔✔You can round a decimal number using `Math.round(double a)`.
1
, What method is used to get a substring from a string in Java?
✔✔You use `String.substring(int beginIndex, int endIndex)` to get a substring.
How do you convert all characters in a string to uppercase in Java?
✔✔You convert all characters to uppercase using `String.toUpperCase()`.
Which method is used to find the square root of a number in Java?
✔✔The method used is `Math.sqrt(double a)`.
How do you check if a character is a digit in Java?
✔✔You check if a character is a digit using `Character.isDigit(char ch)`.
What method would you use to convert an integer to a string in Java?
✔✔You convert an integer to a string using `Integer.toString(int i)`.
How do you find the maximum of two numbers in Java?
✔✔You find the maximum of two numbers using `Math.max(int a, int b)`.
2