answersLogoWhite

0

Why do use typecasting in java?

Updated: 8/20/2019
User Avatar

Wiki User

12y ago

Best Answer

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

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do use typecasting in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Is Javascript better than other scripting languages for web?

This is a very complicated issue but javascript was created to look like java but to be easier to use by nonprogrammers. This is probably one of the most desired traits of the javascript over other languages. javascript doesnot provide typecasting whereas java provides typecasting mechanism.


What is the difference between jdk1.5 and jdk1.6?

Jdk 1.6 has some extra fatures.Some of are - 1.Annotations 2.Enhanced for loop 3.Automatic Typecasting 4.Java 1.6 runs faster than Java 1.5. 5.Java 1.6 makes programming easier by implementing various tools such as SwingWorker and JTable to develop user interface.


Why do you use typecasting?

to pretend our assumption correct.. i,e.. if we gave integers at the beginning of the program and then if we want to get our result in float , we us the method called typecasting by keeping float in braces in the condition or writing integer as float , means 5 as 5.0.


Can you use pointers in java?

Java does not support Pointers and hence you cannot use it in Java.


What is typecasting in java?

typecasting is; in simple language converting form one type to another type. for example. we have the following types in INTEGER 1. byte 2. short 3. int 4. long byte consist of 1 8bits, short consist of 2 8bits, int consist of 4 8bits and long 8 8bits. now to think of this u can store a small box in a big box; but u cant do the other way round. to do the other way round u need to cut the big box into small box dimensions. and then place it. this is wht TYPECASTING will do. so i can store the numbers in INTEGER type if it falls in the range. the following is the range of each 1. byte=-128 to 127 2.short= -32768 to 32767 etc.. so the point is if i have byte a; short b; byte c; c=a+b; this will give me an error. as i am trying to store big value in small size. to do this i will have to typecast it. i.e c= (byte)a+(byte)b; the words in the bracket suggest type casted into. this is typecasting. to know more abt java i found out this amazing channel on youtube. its called as SLIDENEARD. Its a channel dedicated to java programming issues. i hope this helps your purpose.


What technologies link to Java?

Java is exclusive to surfing the web. Some web sites use Java to embed videos, others use Java for advertisements.


Does Java Script use the same compiler as Java?

No


What you use in case of pointer in java?

Java does not have pointers


What is java 7?

Java 7 is the most current version of Java. Many movies and games use Java.


Which is the best Book to understand JAVA in short?

You can use Head First Java or Java Complete Reference to learn Java.


Do you have to use java?

Not usually. There are numerous languages out there with similar functionality. The only time you must use Java is if your employer or client demands that a project be done in Java, or a particular platform requires the use of Java, such as Android OS.


How do you script a RuneScape bot?

RuneScape bots use Java. Use a Java Binary Code.