Character and String Manipulation

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

1/50

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 11:19 AM on 4/16/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

51 Terms

1
New cards

Characters

Java uses primitive data type char when working with _____.

2
New cards

Wrapper Class Character

Java provides ________ for primitive data type char.  Character class offers several useful class like static methods for manipulating characters.

3
New cards

Autoboxing or Unboxing

The Java compiler creates a Character object.  If you pass a primitive char into a method that expects an object, the compiler automatically converts the char to a Character. 

4
New cards

Strings

String greeting = “Hello TIP!”

In the Java programming language, ______ are objects. In the following example, the String object "greeting" has the value "Hello TIP".

5
New cards

Immutable

String class is _______; once it is created, a String object cannot be changed. 

6
New cards

Char Array

Strings in Java are objects that are backed internally by a ______.  Since arrays are immutable, this means that whenever a change to a String is made, an entirely new String is created.

7
New cards

charAt()

Returns the character at the specified index(position).

8
New cards

codePointAt()

Returns the Unicode of the character at the specified index.

9
New cards

codePointBefore()

Returns the Unicode of the character before the specified index.

10
New cards

codePointCount()

Returns the Unicode in the specified text range of the String.

11
New cards

compareTo()

Compares two strings lexicographically.

12
New cards

compareToIngnoreCase()

Compares two strings lexicographically, ignoring case differences.

13
New cards

concat()

Appends a string to the end of another string.

14
New cards

contains()

Checks whether a string contains a sequence of characters.

15
New cards

contentEquals()

Checks whether a string contains the same sequence of characters of the specified CharSequence or StringBuffer.

16
New cards

copyValue()

Returns a String that represents the characters of the character array.

17
New cards

equals()

Compares two Strings. Returns true if the strings are equal, and false if not

18
New cards

equalsIgnoreCase()

Compares two strings, ignoring case considerations

19
New cards

format()

Returns a formatted string using the specified locale, format string, and arguments

20
New cards

getBytes()

Encodes this String into a sequence of byte using the named charset, storing the result into a new byte array.

21
New cards

getChars()

Copies characters from string to an array of chars.

22
New cards

hashCode()

Returns the hash code of a string

23
New cards

indexOf()

Returns the position of the first found occurrence of a specified string

24
New cards

intern()

Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.

25
New cards

isEmpty()

Checks whether a string is empty or not.

26
New cards

lastIndexOf()

Returns the position of the last found occurrence of specified characters in a string

27
New cards

length()

Returns the length of the specified string

28
New cards

matches()

Searches a string for a match against a regular expression, and returns the matches

29
New cards

offsetByCodePoints()

Returns the index within this String that is offset from the given index by codePointOffset code points

30
New cards

regionMatches()

Tests if two string regions are equal

31
New cards

replace()

Searches a string for a specified value, and returns a new string where the specified values are replaced

32
New cards

replaceFirst()

Replaces the first occurrence of a substring that matches the given regular expression with the given replacement

33
New cards

replaceAll()

Replaces each substring of this string that matches the given regular expression with the given replacement

34
New cards

split()

Splits a string into an array of substrings

35
New cards

startsWith()

Checks whether a string starts with specified characters

36
New cards

subSequence()

Returns a new character sequence that is a subsequence of this sequence

37
New cards

substring()

Extracts the characters from a string, beginning at a specified start position, and through the specified number of character

38
New cards

toCharArray()

Converts this string to a new character array

39
New cards

toLowerCase()

Converts a string to lower case letters

40
New cards

toString()

Returns the value of a String object

41
New cards

toUpperCase()

Converts a string to upper case letters

42
New cards

trim()

Removes whitespace from both ends of a string

43
New cards

valueOf()

Returns the primitive value of a String object

44
New cards

String Literal (Static Memory)
Using new keyword (Heap Memory)

Two ways to create string in Java.

45
New cards

CharSequence Interface

Used for representing the sequence of Characters in Java.

46
New cards

String
StringBuffer
StringBuilder
StringTokenizer

Classes that implement CharSequence.

47
New cards

StringBuffer

A peer class of String, it is mutable in nature and it is thread safe class, we can use it when we have multi threaded environment and shared object of string buffer. As it is thread safe so there is extra overhead, so it is mainly used for multithreaded program.

48
New cards

StringBuilder

Represents an alternative to String and StringBuffer Class, as it creates a mutable sequence of characters and it is not thread safe. It is used only within the thread, so there is no extra overhead, so it is mainly used for single threaded program.

49
New cards

StringTokenizer

Used to break a string into tokens.

50
New cards

String Literal
Using new Keyword

How Strings are Stored in Java Memory

51
New cards

Heap

All objects in Java are stored in a ______. The reference variable is to the object stored in the stack area or they can be contained in other objects which puts them in the heap area also.