I am learning about enumerations and I don't understand the purpose this method serves.
Example:
enum Fruits{
apple, pear, orange
}
class Demo{
f = Fruits.valueOf("apple"); //returns apple... but I had to type it!
// so why wouldn't I save myself some time
// and just write: f = Fruits.apple; !?
}