answersLogoWhite

0

Why is there type casting in java?

Updated: 8/19/2019
User Avatar

Wiki User

12y ago

Best Answer

Type casting exists to allow the use of base class or base interface reference but yet if you know that the object in hand is aspecific derived class, you can typecast and access methods available only in the derived class.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why is there type casting in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you change a float into a double using java?

with help of type casting it is possible


Why do use typecasting in java?

Type casting is used to convert from one datatype to the other


What type of government in java?

Java has a Communist government.


How do you find out if your computer has java?

Open cmd and type java


How do you compile your java code?

save it into a .java file. then open command prompt and navigate to your java bin directory. then type CD then your java bin directory. then type this . javac ProgName.java


Where is the java directory?

Nowhere, Just Windows-r and type "JAVA"


What is the return type of finally method in java?

The final and finally keywords have no impact on the return type of a method in Java.


What is gini in Java language?

gini is the one type of extension of the java. gini is the advanced and advanced version of the java


Which type of language is java?

Java is truly object oriented programming language


Is float is a keyword in java?

yes, float is keyword and data type in java


Is button a data type in Java?

In Java, just about anything is defined as a class; a class is a data type, so yes.


Command use on how to run a java program?

You execute it the same way you would on any other OS. As long as you have the Java Runtime Environment installed and the "java" executable is in your path, from the command line you would simply run: java -cp /path/to/file/here com.some.class.to.run.Here