I’m not quite sure what this means or whats it doing, Could some one elaborate?
Player player = (Player) sender;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It takes the object referenced by sender, and attempts to cast it into the type Player. Java objects are strongly typed, which means you have to declare the type of the object.
If the object referenced by sender cannot be cast to a Player object, than an exception will be thrown for an InvalidCast.