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

Which access specifier can be used with class ?

522


What is visibility mode?

521


Difference between static synchronization vs. Instance synchronization?

551


What is proper subset?

528


Explain the use of volatile field modifier?

623






What are the different types of garbage collectors in java?

540


Can list contain null in java?

617


Write a program to find the whether a number is an Armstrong number or not?

567


What is default locale java?

528


What a static class can contains?

687


what are the methods in object?

623


Can we overload the main() method?

540


How do you do a line break in java?

485


Why java is said to be pass-by-value ?

532


Can an abstract class be a final class?

522