Lec 4 Characters and Strings Flashcards
char letter = ‘A’
What type of char is letter?
ASCII
char numChar = ‘4’
what type of char is this?
ASCII
char letter = ‘\u0041’
what type of char is letter?
unicode char
True or False: A java character is stored in 2 bytes
True
What is the output of System.out.println(“smith\exam1\test.txt”)? Pretend there are double \’s
smith\exam1\test.txt
True or false: An int variable can hold ‘x’
True, but ‘x’ = 120
True or false: An int variable can hold ‘120’
False
What does Character.isDigit(ch) return?
Boolean
Whether or not the input is a character that holds a digit, like ‘1’ returns true, but ‘a’ returns false
What does Character.isLetter(ch) return?
Boolean
Whether or not if the character is a letter
What does Character.isLetterOrDigit(ch) return?
Boolean
Whether or not the character is a letter or digit
What does Character.isLowerCase(ch) return?
Whether the character is an uppercase
What does Character.toLowerCase(ch) return?
the lowercase character
What does str.toUpperCase() return?
the uppercase version of str
What does str.charAt(index) return?
the char at the index of str
What does str.concat(“s1”) return?
the concatenated version of str and “s1”