Skip to main content

Back to the full dot-point answer

United StatesComputer ScienceQuick questions

Unit 5: Writing Classes

Quick questions on Writing methods - AP Computer Science A Unit 5

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
Name the four parts of a method header. [1 point]
What is q2?
Show answer
Explain why a non-void method that returns a value only inside an if may fail to compile. [2 points]
What is mismatched return type?
Show answer
The returned value must match the declared type. Returning an int from a method declared boolean is an error.

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.

All Computer ScienceQ&A pages