AP CSA Unit 2: Objects

4.4(9)
Studied by 533 people
0%Unit 2: Using Objects Mastery
0%Exam Mastery
Build your Mastery score
multiple choiceMultiple Choice
call kaiCall Kai
Supplemental Materials
Card Sorting

1/15

Last updated 5:21 PM on 2/20/24
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

16 Terms

1
New cards

object

a data type that is created in Java

2
New cards

Math class

stores common numbers used in mathematical calculations and methods that have mathematical functions

3
New cards

static method

belong to a class but not to any instances of that specific class

can be called without class’s instance or object

4
New cards

Math.abs(x)

gets the absolute value of ‘x’ ; the return value is always positive

5
New cards

Math.pow(x,y)

does ‘x’ to the power of ‘y’ (x^y); the answer will always be a double(decimal) value

6
New cards

Math.PI

stores the value for pi: 3.141592653…

7
New cards

charAt(int x)

returns the char at the given index of ‘x’

8
New cards

contains(String s)

returns true when received string is within the called string, false otherwise

9
New cards

endsWith(String s)

returns true when received string ends with called string, false otherwise

10
New cards

equals(String s)

returns true when the two strings are equal, false otherwise

11
New cards

equalsIgnoreCase(String s)

returns true when the two strings are equal ignoring the case( lower or upper), false otherwise

12
New cards
public class Example{
public static void main(String[] args){
String s = "I like apples";
String g = "ILIKEAPPLES";
//What is returned from this line of code?
System.out.println(s.equals(g));
}
}

false

13
New cards
public class Example{
public static void main(String[] args){
String s = "I like apples";
String g = "ILIKEAPPLES";
//What is returned from this line of code?
System.out.println(toLowerCase(g));
}
}

ilikeapples

14
New cards
public class Example{
public static void main(String[] args){
int x = 2;
int y = 10;

int z = Math.pow(y,x);
System.out.println(z);
}
}

100.00

15
New cards
public class Example{
public static void main(String[] args){
int x = 2;
int y = -10.9;

int z = Math.abs(y);
//what is printed from this program
System.out.println(z);
}
}

10.9

16
New cards
public class Example{
public static void main(String[] args){
String hi  = "hello, John Harvard";

//what is printed from this program?
System.out.println(hi.charAT(7));
}
}

J

Explore top notes

note
Chapter 9: Global Change
Updated 127d ago
0.0(0)
note
AP Human Geography Review
Updated 91d ago
0.0(0)
note
Absorption of Mineral Salts
Updated 337d ago
0.0(0)
note
Skill in Sport
Updated 632d ago
0.0(0)
note
Japanese Imperialism
Updated 1153d ago
0.0(0)
note
Chapter 9: Global Change
Updated 127d ago
0.0(0)
note
AP Human Geography Review
Updated 91d ago
0.0(0)
note
Absorption of Mineral Salts
Updated 337d ago
0.0(0)
note
Skill in Sport
Updated 632d ago
0.0(0)
note
Japanese Imperialism
Updated 1153d ago
0.0(0)

Explore top flashcards

flashcards
Chapter 12 Section 3
35
Updated 334d ago
0.0(0)
flashcards
ASTR101 2nd Exam
33
Updated 727d ago
0.0(0)
flashcards
Gli Aggettivi
58
Updated 862d ago
0.0(0)
flashcards
🤐Unit VI
84
Updated 728d ago
0.0(0)
flashcards
Cellular Respiration Test
29
Updated 1097d ago
0.0(0)
flashcards
French - Body Parts
21
Updated 1108d ago
0.0(0)
flashcards
French Useful Words
22
Updated 1021d ago
0.0(0)
flashcards
Chapter 12 Section 3
35
Updated 334d ago
0.0(0)
flashcards
ASTR101 2nd Exam
33
Updated 727d ago
0.0(0)
flashcards
Gli Aggettivi
58
Updated 862d ago
0.0(0)
flashcards
🤐Unit VI
84
Updated 728d ago
0.0(0)
flashcards
Cellular Respiration Test
29
Updated 1097d ago
0.0(0)
flashcards
French - Body Parts
21
Updated 1108d ago
0.0(0)
flashcards
French Useful Words
22
Updated 1021d ago
0.0(0)