Knowledge quiz

It's time to put what you've learned to the test, get 7 right to pass this unit.

1.

A functional method must have

Choose the correct answer.
2.

You have defined a class containing instance attributes and static attributes. You have also declared a reference variable but not yet created an instance of the class. Which components of the class can you access at this point, and how?

Choose the correct answer.
3.

Which of the following signature elements may an instance constructor have?

There are two correct answers.
4.

A class my_class contains the public static method my_method. What is the correct code to call this method?

Choose the correct answer.
5.

In which order do you define the visibility sections of a class?

Choose the correct answer.
6.

You have declared two reference variables, ref1 and ref2. ref1 points to an object. You now execute the statement ref2 = ref1. What happens?

Choose the correct answer.
7.

Your class contains a public instance attribute attr. How could you ensure that its value can only be changed within the class?

There are two correct answers.
8.

The static constructor is executed when the class is addressed for the first time. When might this be?

There are two correct answers.