answersLogoWhite

0

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.

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Why do use typecasting in java?

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


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.


What has the author Paul Hayden Duensing written?

Paul Hayden Duensing has written: 'Stereo-types' 'Some types of note' 'Fourth biennial American Typecasting Fellowship conference' -- subject(s): American Typecasting Fellowship 'On type'


Is Dustin Hoffman is one example of an actor who has been caught in the typecasting trap?

false


When the director deliberately puts someone who does not appear to be right for the part in a role is known as?

typecasting


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.


Typecasting the process by which an actor gets cast in a narrow range of almost identical roles always enhances an actors growth as an artist?

False


What Indonesian island is Jakarta on?

java


Does Visual Java plus plus and Java Builder is different from the Java language?

Yes!Visual Java plus plus and Java Builder is different from the Java language?


What are the different java technologies?

There are several types of Java technology. Some examples of Java software are Java ME, Java EE, Java SE, and Java Card. Java made the JAVA development kit for those that develop in Java. There is also Java Virtual machine and some class libraries. Java is also famous for its languages like Clojure, Beanshell, Groovy, Gosu, Rhino, Kotlin, JRuby, Scala, and Jython.


Small Java-based programs are called?

Java applets