What this deck covers
This deck focuses on Methods Passing And Returning References, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Study Methods Passing And Returning References in AP Computer Science a with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.
0% Complete
Which keyword is necessary to return an object from a method?
Tap card or press Space to flip
return. Required for all method returns.
How well did you know it?
Card 1 / 71
Space to flip · ← / → to move · once flipped, → Got it · ← Still learning
This deck focuses on Methods Passing And Returning References, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science a.
Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.
Answer: return. Required for all method returns.
Answer: Returns no object, just null. Explicitly returns no object reference.
Answer: No object is returned; it represents nothing. Null indicates no object reference exists.
Answer: The method can modify the object's fields. Reference passing enables object modification.
Answer: Use the object's class as parameter type. Parameter type must match the object's class.
Answer: public MyClass methodName(). Return type matches the class name.
Answer: Use the 'return' keyword followed by the object. Return statement sends object reference back.
Answer: It signifies no object is being returned. Null means no valid object reference.
Answer: NullPointerException if dereferenced. Accessing null reference throws runtime exception.
Answer: public MyClass methodName(). Method signature shows return type and parameters.
Answer: Returns the current instance of the class. Enables method chaining and self-reference.
Answer: methodName(ObjectType objectName). Parameter syntax includes type and variable name.
Answer: The method can modify the object's fields. Reference passing enables object modification.
Answer: When using 'new' keyword inside the method. Constructor calls create new object instances.
Answer: Any method with a non-void return type. Non-void methods can return object references.
Answer: Returns the current object reference. 'this' refers to the current object instance.
Answer: return. Required for all method returns.
Answer: Risk of NullPointerException if dereferenced. Null references cause exceptions when used.
Answer: Use 'void' as the method's return type. Void indicates no return value expected.
Answer: null. Methods return null when no object is provided.
Answer: Returns the current object reference. 'this' refers to the current object instance.
Answer: methodName(object);. Object name without parentheses passes reference.
Answer: return "Example";. String literals return String object references.
Answer: Missing semicolon after 'name'. Missing semicolon terminates return statement.
Answer: No object is being returned. Explicit way to return no object.
Answer: return new ObjectType();. Constructor creates and returns new object.
Answer: methodName(ObjectType objectName). Parameter syntax includes type and variable name.
Answer: public MyClass methodName(). Return type matches the class name.
Answer: methodName(object);. Object name without parentheses passes reference.
Answer: Correct: 'return objectName;'. Parentheses invoke method; remove for variable return.
Answer: Check for null before using the return value. Prevents NullPointerException when accessing.
Answer: The modification persists outside the method. Object state changes persist after method ends.
Answer: Changes persist outside the method. Reference passing means original object is modified.
Answer: public MyClass methodName(). Method signature shows return type and parameters.
Answer: NullPointerException if dereferenced. Accessing null reference throws runtime exception.
Answer: Modification does not persist outside. Primitives are passed by value, not reference.
Answer: return new ObjectType();. Constructor creates and returns new object.
Answer: The method can modify the object's state. Reference allows access to the original object.
Answer: Error: method has void return type. Void methods cannot return any value.
Answer: Returns no object, just null. Explicitly returns no object reference.
Answer: Modification does not persist outside. Primitives are passed by value, not reference.
Answer: Correct: 'return objectName;'. Parentheses invoke method; remove for variable return.
Answer: return "Example";. String literals return String object references.
Answer: The reference to the object. Memory address, not the entire object.
Answer: The reference to the object. Memory address, not the entire object.
Answer: Use the 'return' keyword followed by the object. Return statement sends object reference back.
Answer: The method does not return an actual object. Null represents absence of an object reference.
Answer: Use the object's class as parameter type. Parameter type must match the object's class.
Answer: null. Methods return null when no object is provided.
Answer: When using 'new' keyword inside the method. Constructor calls create new object instances.
Answer: No object is being returned. Explicit way to return no object.
Answer: Error: method has void return type. Void methods cannot return any value.
Answer: Passing the memory address of the object. Objects are passed by reference, not value.
Answer: Any method with a non-void return type. Non-void methods can return object references.
Answer: The return type and the object's type. Type compatibility ensures valid returns.
Answer: It signifies no object is being returned. Null means no valid object reference.
Answer: The modification persists outside the method. Object state changes persist after method ends.
Answer: Missing semicolon after 'name'. Missing semicolon terminates return statement.
Answer: The return type and the object's type. Type compatibility ensures valid returns.
Answer: return. Basic keyword for returning any value or reference.
Answer: Returns the current instance of the class. Enables method chaining and self-reference.
Answer: The method does not return an actual object. Null represents absence of an object reference.
Answer: return. Basic keyword for returning any value or reference.
Answer: An object or a reference to an object. Return type determines what can be returned.
Answer: Check for null before using the return value. Prevents NullPointerException when accessing.
Answer: No object is returned; it represents nothing. Null indicates no object reference exists.
Answer: Risk of NullPointerException if dereferenced. Null references cause exceptions when used.
Answer: Changes persist outside the method. Reference passing means original object is modified.
Answer: Use 'void' as the method's return type. Void indicates no return value expected.
Answer: The method can modify the object's state. Reference allows access to the original object.
Answer: An object or a reference to an object. Return type determines what can be returned.