String basics
Constructors
Boolean basics
instance variables
100

what string method finds the position of '-' in "3-8"? 

indexOf()

100

this method runs automatically when you create a new object 

constructor 

100

this operator returns true only if both conditions are true

&& 

100

if you write int feet = 5; inside a constructor, this creates what type of variable? 

local 

200
Using charAt() on an int causes this 
compile-time error
200

a constructor must have the same name as this 

class name 

200

the expression !(false && true) evaluates to this 

true

200

if a constructor parameter has the same name as an instance variable, what key word refers to the instance variable

this

300

what string method extracts part of a string using start and end positions? 

substring()

300

This java keyword can be used in a constructor to enforce that a condition like b != 0 is true during development 

assert

300

what does !(false || true) evaluate to? 

false
300

which type of variable belongs to the object itself and is declared outside of the constructor? 

instance variable 

400

what method converts "8" into the integer 8? 

Integer.parseInt()

400

if a and b are not allowed to be equal to 0, and the constructor allows a = 0 and b = 0 the object can enter this undesirable condition 

invalid state

400

what is the difference between && and || 

&& requires both conditions to be true 

|| requires at least one condition to be true

400

if a constructor parameter has the same name as an instance variable and you do not use this, which variable gets assigned? 

the parameter (local variable) 

500

what does this print?

String s = "2-6";
int dash = s.indexOf('-');
System.out.println(s.substring(dash)); 

-6

500

once an object is created, it should always satisfy its rules. This principle is called maintaining ____

class invariants 

500

why does the order of conditions matter when using &&? 

because the first condition may prevent the second from executing. 

500

what will getFeet() return after this constructor runs?

private int feet = 3 

public Measurement(int feet) { 

     feet = feet + 2; 

}

instance variable never updated