1/53
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Java provides many useful methods in the ________________ for performing common mathematical functions
math class
class constants
Math.pi, Math.E
returns the trigonometric sine of an angle in radians
Math.sin
returns the trigonometric cosine of an angle in radians
Math.cos
returns a raised to the power of b
pow(a, b)
returns a raised to the power of b
sqrt(x)
x rounded up to its nearest integer. This integer is returned as a double value
ceil(x)
x rounded down to its nearest integer. This integer is returned as a double value
floor(x)
x rounded to its nearest integer. If x is equally close to two integers, the even one is returned as a double.
rint(x)
x rounded to its nearest integer. If the first decimal place is <= .4, then round down, otherwise round up.
round(x)
returns the maximum or minimum of two parameters.
max(a, b) or min(a, b)
returns the absolute value of the parameter
abs(a)
a character data type represents a _____
single character
a string is enclosed in, a character is enclosed in
“ “, ‘ '
what can be used on char variables to get the next or preceding character?
increment and decrement operators
unicode can represent_____ characters
65536
ASCII code for 0-9
48-57
characters ‘A’ to ‘Z’ decimal values
65-90
characters ‘a’ to ‘z’ decimal values
97-122
unicode takes ____ bytes and is preceded by ___
2, \u
unicode is expressed in __________ numbers
4 hexadecimal
unicode runs from _______ to ________
‘\u0000’, ‘\uFFFF’
tab
\t
newline
\n
double quote
\”
format specifier: boolean value (true or false)
%b
format specifier: character ‘a’
%c
format specifier: integer
%d
format specifier: floating point number (~double)
%f
format specifier: string “ “
%s
specifies how an item should be displayed
format specifier
convert number into string
String s = “ “ + number;
convert numeric string into an int value (similar for double value)
int intValue = Integer.parseInt(intString);
To find a character/substring in a string, use the different format of the _________ and _________ methods
indexOf() and lastIndexOf()
Returns a substring that begins with the character at the specified beginIndex and extends to the character at index endIndex - 1
substring(beginIndex, endIndex)
returns a n integer > 0, == 0, < 0 to indicate whether the string is greater than, equal to, or less than s
compareTo(s1)
returns true if the string is equal to string s
equals(s1)
reading a string: invoke ____ method on a Scanner object
next()
method to read an entire line of text
nextLine()
the string type is not a primitive type, it is known as
reference type
returns the number of characters in the string
length()
returns the character at the specified index from the string
charAt(index)
get last letter method:
message.length() - 1
returns a new string that concatenates in the string with string s1
concat(s1)
returns a new string with all letters in uppercase
toUpperCase()
returns a new string with all letters in lowercase
toLowerCase()
returns a new string with whitespace characters trimmed on both sides
trim()
returns true if the specified character is a digit
isDigit(Ch)
returns true if the specified character is a letter
isLetter(ch)
returns true if the specified character is a letter or digit
isLetterOrDigit(ch)
returns true if the specified character is lowercase letter
isLowerCase(ch)
returns true if the specified character is uppercase letter
isUpperCase(ch)
returns the lowercase of the specified character
toLowerCase(ch)
returns the uppercase of the specified character
toUpperCase(ch)