Back to the full dot-point answer
United StatesComputer ScienceQuick questions
Unit 2: Using Objects
Quick questions on Calling a void method with parameters - AP Computer Science A Unit 2
3short Q&A pairs drawn directly from our worked dot-point answer. For full context and worked exam questions, read the parent dot-point page.
What is q1?Show answer
A method header is void setSpeed(int speed). Write a valid call on an object car that sets the speed to 60. [1 point]
What is q2?Show answer
Explain why a void method changing its int parameter does not change the caller's matching variable. [2 points]
What are wrong number of arguments?Show answer
Supplying too few or too many arguments does not compile, even if the types you do supply are correct.
Have a question we have not covered?
This dot-point answer is short enough that we have not extracted many short questions yet. Read the full dot-point answer or ask Mo, our study assistant, in the chat for follow ups.