In generall, you are allowed to explicit cast only, if a correct type cast is "possible". If the compiler "thinks", it is not, there will be a runtime exception.
e.g.: you declaired:
Juicy_Fruit JF1 = new Juicy_Fruit();
Because it is obvious, that a Juicy_Fruit object never could be e.g. a String object it is not allowed to cast
String s = (String) JF1;
But if you would have declaired
Object o = new Juicy_Fruit();
than String s = (String) JF1 ; would be no problem for the compiler (not talking about runtime right now) because an Object of type Object could be everything, so why not a String?
So for the compiler everything you codes is just fine
#1 is even an implicit cast (or would be, if you didnt tipe it explicite) as JF1 IS A sweet
#2 is ok for compiler (as JF1 could be a Round_Fruit because Round_Fruit IS A Juicy_Fruit
#3 is ok also because Juicy_Fruit IS A Fruit, so a Fruit-object could be a Juicy_Fruit
At runtime you have to ask yourself : is the object really what i�m trying to make out of it?
#2 is problematic because JF1 could be a Round_Fruit but IT IS NOT. So here a ClassCastException will be thrown.