I am new to Java and I have a rather simple question, because I can't understand what it is doing and in Scala, the programming language I programmed with before, doesn't "do" or "have" such a thing.
So lets assume we have a class named "Pet" and my code snippet is:
Pet myPet = (Pet) myPet.getPetName();
What exactly is the
(Pet)
doing here in front of the "myPet.getPetName?
Please delete my question or mark it as duplicate if there exists one but I couldn't find any solution because I dont know how this is called?