{ "@context": "https://schema.org", "@type": "Organization", "name": "Brainscape", "url": "https://www.brainscape.com/", "logo": "https://www.brainscape.com/pks/images/cms/public-views/shared/Brainscape-logo-c4e172b280b4616f7fda.svg", "sameAs": [ "https://www.facebook.com/Brainscape", "https://x.com/brainscape", "https://www.linkedin.com/company/brainscape", "https://www.instagram.com/brainscape/", "https://www.tiktok.com/@brainscapeu", "https://www.pinterest.com/brainscape/", "https://www.youtube.com/@BrainscapeNY" ], "contactPoint": { "@type": "ContactPoint", "telephone": "(929) 334-4005", "contactType": "customer service", "availableLanguage": ["English"] }, "founder": { "@type": "Person", "name": "Andrew Cohen" }, "description": "Brainscape’s spaced repetition system is proven to DOUBLE learning results! Find, make, and study flashcards online or in our mobile app. Serious learners only.", "address": { "@type": "PostalAddress", "streetAddress": "159 W 25th St, Ste 517", "addressLocality": "New York", "addressRegion": "NY", "postalCode": "10001", "addressCountry": "USA" } }

Unit 2 (Strings and Classes) Flashcards

(12 cards)

1
Q

array definition

A

int[] num = new int[length];
int [] num = {1, 2, 3, 4, 5};
Arrays are fixed in length

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

2d array definition

A

int[][] matrix = {
{1, 2, 3, 4},
{5, 6, 7, 8},
{9, 10, 11, 12}
};

int[][] jagged = new int[3][];
jagged[0] = new int[2];
jagged[1] = new int[4];
jagged[2] = new int[1];

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

order of operations

A

() []
++, –
% / *
+, -
< > <= >=
== !=
&&
||
= += -= etc

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

When to use .length vs .length()

A

.length for arrays
.length() for strings

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

The size of an array is immutable. You cannot ever change the size of an array

A

Check the answers when tracing to eliminate any options with changed array length

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

when iterating thru a array, what is the iteration

A

(int x: arr){
}

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

when iterating thru a 2d array, what is the iteration

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly