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 is it called boolean?

527


Describe the syntax of multiple inheritance? When do we use such an inheritance?

588


Can we sort arraylist in java?

565


Why vector class is used?

544


worst case complexities of Quick sort and Merge sort.

606






What do you understand by classes in java?

562


What is the longest unicode character?

695


what is the difference between yielding and sleeping? : Java thread

525


What is the use of :: in java?

570


What is difference between ++ I and I ++ in java?

533


What is the Scope of Static Variable?

732


how to create multithreaded program? Explain different ways of using thread? : Java thread

534


How objects of a class are created if no constructor is defined in the class?

580


What is a constructor, constructor overloading in java?

530


Why is multiple inheritance not supported in java?

561