I'm studying "Programming in Java An Interdisciplinary Approach by Sedgewick and Wayne". The following question is giving me a bit of a challenge to implement.

Write a static method odd() that takes three boolean inputs and returns true if an odd number of inputs are true, and false otherwise.

```
private static boolean odd(boolean x, boolean y, boolean z)
{
if((x && y) && z)
return true;
else if((x) && !y && !z)
return true;
else if((y) && !x && !z)
return true;
else if((z) && !x && !y)
return true;
else
return false;
}
```

Could I have implemented this a different way?