Can we add two byte variables and assign the result to a
byte variable ?
b=b1+b2 where b,b1,b2 are byte types

Answer Posted / guest

yes.But you have to cast that variable before adding.

eg:
byte b=(byte)b1+(byte)b2

Is This Answer Correct ?    7 Yes 35 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is the best sorting technique in java?

531


Explain the features of interfaces in java?

561


What does main method?

570


What is an image buffer?

543


what is daemon thread and which method is used to create the daemon thread? : Java thread

539






What is an 8 bit word?

600


What is the difference between conversation & casting?

584


How to instantiate member inner class?

633


What is preflight request?

535


What is the synchronized method modifier?

596


Is integer passed by reference in java?

574


Is call by reference possible in java?

543


Is space a character in java?

526


How many techniques can be employed to create a string object?

564


What is a bubble sort in java?

553