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 / rajesh

Yes,the following is the right way to do so
byte b1=21;byte b2=11;
byte b;
b=(byte)(b1+b2);

Is This Answer Correct ?    39 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why are pointers not secure?

541


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

565


What happens when main () method is declared as private?

656


Is java a compiler?

573


What is meant by method?

583






What is a class object?

506


Is java hashset ordered?

586


Does isempty check for null?

565


What are the data types supported by java?

552


What is the reflection?

569


Why java is called not pure object oriented language?

585


Why stringbuffer is faster than string?

551


What is a singleton factory?

518


Is sizeof a preprocessor?

550


Can we have any code between try and catch blocks?

565