Text Processing and Wrapper Classes

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/39

flashcard set

Earn XP

Description and Tags

Flashcards covering Java text processing, String methods, the StringBuilder class, and numeric wrapper classes based on Chapter 9 of Java Control Structures Through Objects.

Last updated 6:08 PM on 8/10/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

40 Terms

1
New cards

Wrapper classes

Classes that are "wrapped around" a primitive data type, allowing you to create objects to represent a primitive.

2
New cards

Immutable

A characteristic of wrapper class objects meaning that once you create an object, you cannot change the object’s value.

3
New cards

java.lang

The package that contains wrapper classes, meaning no import statement is required to use them.

4
New cards

Character class

A class that allows a char data type to be wrapped in an object and provides static methods for testing, processing, and conversion.

5
New cards

Character.isDigit(charch)Character.isDigit(char\,ch)

Returns true if the argument passed into ch is a digit from 00 through 99. Otherwise returns false.

6
New cards

Character.isLetter(charch)Character.isLetter(char\,ch)

Returns true if the argument passed into ch is an alphabetic letter. Otherwise returns false.

7
New cards

Character.isLetterOrDigit(charch)Character.isLetterOrDigit(char\,ch)

Returns true if the argument passed into ch contains a digit from 00 through 99 or an alphabetic letter. Otherwise returns false.

8
New cards

Character.isLowerCase(charch)Character.isLowerCase(char\,ch)

Returns true if the argument passed into ch is a lowercase letter. Otherwise returns false.

9
New cards

Character.isUpperCase(charch)Character.isUpperCase(char\,ch)

Returns true if the argument passed into ch is an uppercase letter. Otherwise returns false.

10
New cards

Character.isSpaceChar(charch)Character.isSpaceChar(char\,ch)

Returns true if the argument passed into ch is a space character. Otherwise returns false.

11
New cards

Character.isWhiteSpace(charch)Character.isWhiteSpace(char\,ch)

Returns true if the argument passed into ch contains a whitespace character (a space, tab, or newline character). Otherwise returns false.

12
New cards

Empty string

A string that has a length of 00, which means it contains no characters.

13
New cards

Blank string

A string that is either empty or contains only whitespace characters.

14
New cards

isBlank()isBlank()

A String class method that returns true if the calling string is empty (its length is 00) or it contains only whitespace characters.

15
New cards

isEmpty()isEmpty()

A String class method that returns true if the length of the calling string is 00.

16
New cards

Substring

A string that is part of another string.

17
New cards

containscontains

A String class method that returns true if the calling string object contains a particular substring.

18
New cards

startsWith(Stringstr)startsWith(String\,str)

Determines whether a string begins with a specified substring using a case sensitive comparison.

19
New cards

endsWith(Stringstr)endsWith(String\,str)

Determines whether a string ends with a specified substring using a case sensitive comparison.

20
New cards

regionMatchesregionMatches

A String class method that determines if specified regions of two strings match, with an optional boolean to ignore case.

21
New cards

indexOfindexOf

Returns the first location of a substring or character in the calling String Object; returns negative 11 if not found.

22
New cards

lastIndexOflastIndexOf

Returns the last location of a substring or character in the calling String Object; returns negative 11 if not found.

23
New cards

substring(intstart)substring(int\,start)

A String class method used to extract and return a substring beginning at a start location.

24
New cards

getCharsgetChars

A String class method that stores a substring in a char array.

25
New cards

toCharArraytoCharArray

A String class method that returns the String object’s contents in an array of char values.

26
New cards

concatconcat

Returns a String object that is the concatenation of two String objects.

27
New cards

replace(charoldChar,charnewChar)replace(char\,oldChar, char\,newChar)

Returns a String object with all occurrences of one character being replaced by another character.

28
New cards

indent(intn)indent(int\,n)

Returns a copy of the calling String object with each line's indentation adjusted; positive nn adds spaces, while negative nn removes them.

29
New cards

strip()strip()

Returns a copy of a String object with all leading and trailing whitespace characters removed.

30
New cards

valueOfvalueOf

Static overloaded methods in the String class that return a String object representation of a primitive value or a character array.

31
New cards

StringBuilder class

A class similar to String, but whose objects are mutable and can grow or shrink in size to accommodate changes.

32
New cards

appendappend

A StringBuilder method that appends a string representation of an argument, such as a primitive or char array, to the current contents.

33
New cards

insert(intstart,item)insert(int\,start, item)

A StringBuilder method that accepts a position and a value to be inserted at that specific location.

34
New cards

deleteCharAt(intindex)deleteCharAt(int\,index)

A StringBuilder method used to delete a single character at a specified position.

35
New cards

split(Stringdelimiter)split(String\,delimiter)

A String class method that tokenizes a String object and returns an array of String objects where each element is one token.

36
New cards

Numeric Primitive Wrapper Classes

Includes Byte, Double, Float, Integer, Long, and Short, which apply to their respective numeric primitive types.

37
New cards

Parse methods

Static methods in numeric wrapper classes, such as parseInt, that convert a string representing a number into a numeric data type.

38
New cards

NumberFormatExceptionNumberFormatException

The exception thrown by parse methods if the String object does not represent a numeric value.

39
New cards

Autoboxing

The automatic conversion the Java compiler makes between the primitive types and their corresponding object wrapper classes when a primitive value is assigned to a wrapper class variable.

40
New cards

Unboxing

The process of automatically converting a wrapper class object to its corresponding primitive data type.