Which of the following is poor design?

a. A data field is derived from other data fields in the same class.
b. A method must be invoked after/before invoking another method in the same class.
c. A method is an instance method, but it does not reference any instance data fields or invoke instance methods.
d. A parameter is passed from a constructor to initialize a static data field.


abcd A is not good because there is no need to define the data field if it can be derived from other data fields. B is not good because it is highly problematic to impose any order for invoking the methods. C is a bad design because in this case the method should be defined as static. D is not good because a static data field is now tied to the creation of a specific object, which should not be the case.

Computer Science & Information Technology

You might also like to view...

What value is assigned to lblSum.Text by the following code ?

``` Dim intTotal As Integer = 0 For intOuter = 1 To 3 For intInner = intOuter To 3 intTotal += intOuter * intInner Next Next lblSum.Text = intTotal.ToString() ``` a. 9 b. 16 c. 25 d. 36

Computer Science & Information Technology

What are three reasons to use NFS?

What will be an ideal response?

Computer Science & Information Technology

The ________, which acts as the "cloud," is never physically seen by the user

Fill in the blank(s) with correct word

Computer Science & Information Technology

An object acts as a general template and a class is a specific item generated based on the object template.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology