Samsung Electronics interview question

Java casting. if B extends A, can you do something like this? ((A) B).methodOfA