# MLE for special uniform cases

I prepare my exam and I came across this question:

Let $$X_1, X_2, …, X_n$$ be iid with PDF $$f (x) = frac {2x} { theta ^ 2}$$ for $$0 leq x leq theta.$$ Find the MLE of $$theta$$

So here's what I did:

$$L ( theta) = prod frac {2x_i} { theta ^ 2} I (0 leq x leq theta)$$

$$= (2n bar {x}) ( frac {1} { theta ^ {2n}}) I (0 leq min (x_i) leq max (x_i) leq theta)$$

$$= (2n bar {x}) ( frac {1} { theta ^ {2n}}) I (0 leq X _ {(1)} leq X _ {(n)} leq theta$$

In order to find MLE, I have to maximize $$L ( theta)$$, by choosing a small $$theta$$. however, $$theta$$ can not be smaller than $$X_n$$. I therefore conclude that:

$$hat { theta} = max (x_i)$$

Is my calculation and my conclusion correct?