3. Class Creation

Writing Methods — Quiz

Test your understanding of writing methods with 5 practice questions.

Read the lesson first

Practice Questions

Question 1

What is the main purpose of a method in a class?

Question 2

Which statement best describes a method signature?

Question 3

In the method header $public int add(int a, int b)$, what does $int$ tell you?

Question 4

What is a parameter in a method?

Question 5

Why are private instance variables often used in a class?