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

Can we extend private class in java?

557


What is encapsulation in java?

637


What are the advantages of inner classes?

513


What is map in java?

526


What is the parse method in java?

580






Is math an abstract class in java?

546


What is boolean in java?

519


Name the components that are termed to be Heavy-weight component but available in Light-weight components?

1991


Why Java is not pure Object Oriented language?

663


What is thread count in java?

555


What is a local block?

652


what is mutual exclusion? : Java thread

562


What is empty list in java?

635


What is callablestatement? How you can call stored procedure to pass in parameter?

549


How many types of flags are there?

532