pronouns - Proper usage of 'which' in a sentence
I read the post Usage of "which", and am trying to frame my own sentence that uses "which".
Consider the sentences below. In the first, I want to say that variable shadowing is the reason that Class Sheltie does what it does. In the second, that the default constructor is also the body of the class. Is which correctly used?
• Class Sheltie of Dog.scala illustrates variable shadowing, which also explains why this class does what it does.
• This causes the default constructor to be invoked, which happens to be the body of the class itself.
Answer
• Class Sheltie of Dog.scala illustrates variable shadowing, which also explains why this class does what it does.
The usage of which clouds the issue, in my opinion. To avoid confusion, you might rewrite this as:
Class Sheltie of Dog.scala exists to illustrate variable shadowing.
Regarding your second sentence:
• This causes the default constructor to be invoked, which happens to be the body of the class itself.
I believe this is a clear and proper use of which. You might say that the default constructor constitutes the body of the class as I get the feeling there are no other methods.
Comments
Post a Comment