Strings And Arrays Flashcards

(29 cards)

1
Q

___ are a sequence of characters widely use in java programming.

A

Strings

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

___ is a series of characters found in a double quotes and is considered constants

A

String Literal

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

it commonly uses characters, symbols, and letters but it should be enclosed with double quotes.

A

String

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

This is an example with a what?

String strName;
strName = “Harley”;

A

string literal and strName

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In this part Each character in a string has a specific position wherein the position of the first character starts at index 0. What is this ?

A

String Index

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

A ___ is a block of code that initializes a newly created object. The String class has 13 constructors that provide the initial value of the string using different sources.

A

constructor

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

The String class has ___ constructors that provide the initial value of the string using different sources.

A

13

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Recite the two(2) ways on how a string can be written.

A

•by directly assigning a string literal to a String object.
•by using the new keyword and String constructor to create a String object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the default constructor to create an empty string.

A

String()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

the most common String constructor used in Java. It creates a new String
object in the heap area and stores the given value in it.

A

String(String str)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

it used to create a String object and store the array of characters in it.

A

String(char chars[])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

It used to create and initialize a String
object with a subrange of a character array.

A

String(char chars [], int startIndex, int count)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

This used to create a new String object by decoding the given array of bytes such as by decoding ASCII values according to the system’s default character set.

A

String(byte byte Arr[])

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

this constructor also creates a new String object by decoding the ASCII values of the current string using the system’s default character.

A

String(byte byteArr[], int startIndex, int count)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

The String class has various methods used to perform operations on Strings.

A

String Methods

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

This method returns the character present in the specified index.

17
Q

This method removes the leading (starting) and trailing(ending) whitespaces from a string.

18
Q

This method changes the matching occurrences of a text or character in the string with the new text or character.

19
Q

This method returns true if two strings are identical and false if otherwise.

20
Q

This method changes all characters in the string to lowercase or minuscule characters.

A

toLowerCase()

21
Q

This method returns the number of characters in a string.

22
Q

This method returns a new string based on two (2) concatenated or joined strings.

23
Q

This method returns the index or position of the first occurrence of the specified character/substring within
the string.

24
Q

This method compares or matches two (2) strings based on the dictionary order. This comparison is based on
the Unicode value of each character in the string.

25
it represents data in a connected space in the computer memory. It is a collection of elements (a fixed number of variables) of the same data type referenced by a common name.
array
26
An Arrays must be ?
declared first and then initialized to create and use an array in Java.
27
What are the two (2) types of arrays?
One-dimensional Multi dimensional
28
A single or one-dimensional array is a list of the same typed variables.
One dimensional array
29
A _________ refers to an array of arrays. To declare one, the additional index must be specified using another set of square brackets.
multi-dimensional array