Java has compile-time type checking. That is, you have to declare what class of object each reference points to, and you can only (directly[*]) call methods applicable to that class.
This is different to some other languages that only have run-time type checking. In Python or JavaScript, for instance, you do not declare what type a variable has. Each method call is only checked at run-time, and succeeds or fails according to the run-time type of the object on which it is called.
In Java, you can use casting to change the compile-time class of an object reference; it generally only makes sense to cast to a subclass of the object reference's current class. You can change an FooSuper object reference to a Foo object reference by casting. When you cast, you are saying to the compiler that you know what class of object is really pointed to by the object reference. A check occurs at run-time and throws ClassCastException if what you said isn't true.
Casting does not do anything to the actual object. You cannot change a Foo object to a Bar object by casting. Actually, you cannot change an object's class at all.
[*] Java Reflection includes another way to call Java methods, which bypasses most compile-time checks and leaves everything to run-time. It has many uses, but should not be used when simple non-reflection code would do, because (a) reflection code is long-winded, (b) the compile-time checks help to find bugs.