Concept explainers
The isDigit, isLetter, and isLetterOrDigit methods are members of this class.
- a. String
- b. Char
- c. Character
- d. StringBuilder
Methods of the class:
The methods “isDigit”, “isLetter”and “isLetterOrDigit” are some of the members of the class “Character”.
Hence, the correct answer is option “C”.
Explanation of Solution
Character class:
- A wrapper class that is used for the char data type is called as “Character” class.
- It contains various method for testing and converting the data that is of character type.
- The character is a part of “java.lang” package and it does not needed to be imported for using the class.
- It contains various static methods for testing the value of the character variables.
Reason for the incorrect answers:
String:
The class is used to represent character of strings.
Hence, the option “A” is wrong.
Char:
“char” is considered as the data type but not the class.
Hence, the option “B” is wrong.
StringBuilder:
The class is used to create a changeable strings and it is similar to String objects.
Hence, the option “D” is wrong.
Want to see more full solutions like this?
Chapter 8 Solutions
Starting Out with Java: Early Objects (6th Edition)
Additional Engineering Textbook Solutions
Starting Out with Java: From Control Structures through Objects (6th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Database Concepts (8th Edition)
Starting Out with Python (3rd Edition)
Introduction to Programming Using Visual Basic (10th Edition)
Concepts of Programming Languages (11th Edition)
- Method called reverse that reverses a string passed to this method as a parameter and returns the reversed string. Eg reverse(“string”) should return “gnirts”. Print out the reversed string in your main method. Hint: Use CharAt or Substring methods from the String Class.arrow_forward/*** Returns a new string that is filled with length number of BLANK characters (e.g., initGuess(5, "$") would return the String "$$$$$""* @param length* @param BLANK* @return a new string that is filled with length number of blank characters* */public static String initGuess(int length, char BLANK) {return "string";}arrow_forwardIn the class String, the substring method inserts a String into another String. -True or -Falsearrow_forward
- The String class has several overloaded versions of a method that accepts a value of any primitive data type as its argument and returns a string representation of the value. The name of the method is ___________.a. stringValueb. valueOfc. getStringd. valToStringarrow_forwardC sharp Write a method that accepts a string as an argument and checks it for proper capitalization and punctuation. The method should determine if the string begins with an uppercase letter and ends with a punctuation mark. The method should return true if the string meets the criteria; otherwise, it should return false.arrow_forwardThis string method returns true if a string contains only numeric digits and is at least one character in length.a. the digit methodb. the isdigit methodc. the numeric methodd. the isnumber methodarrow_forward
- public static int createMirror(String str) write your code to calculate the number of characters that should be removed from a string so that it becomes a mirrored word. dont use 3rd party libraries and java.utilarrow_forwardWhen you want to know the position of the substring, you can use one of the __________ of a string object. a. TrimStart or TrimEnd methods b. IndexOf or LastIndexOf methods c. ToLower or ToUpper methods d. StartsWith or EndsWith methodsarrow_forward/*** Returns a lowercase version of a user-entered letter* @param kbd* @return lowercase version of user-entered letter*/public static char getNewGuess(Scanner kbd) {String str = kbd.nextLine();str=str.toLowerCase();return str.charAt(0);} this is what i have but it doesn't seem to be correct completely, it says that the return value needs to be the first letter entered at the beginning of a linearrow_forward
- **CODE SHOULD BE IN JAVA** Enter a String value as a variable “word”: “Instructorcanofferminimalhints” Create a method that is called “showPairs(String word)” In the method, the program shows us “word” that is separated by 2 characters. Output Should be: Enter whole word: Instructorcanofferminimalhints In st ru ct or ca no ff er mi ni ma lh in tsarrow_forwardWhat will the following Code segment print on the screen? String LName = "FamilyName"; String FName = "GivenName"; System.out.println("Dear Mr " + LName); System.out.println("We would like to call you " + FName);arrow_forwardThis method returns a string with a number of vertical bars that correspond to the bars parameter. The method most not rely on System.out.println(). No arraysarrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT