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

What variables are stored in stack?

759


Define immutable object?

865


What is the meaning of variable in research?

785


How to overcome the exception object reference not set to an instance of object?

911


What is overriding in java?

779


How to pass arraylist to stored procedure in java?

801


What is the maximum size of hashmap in java?

764


How finally used under exception handling?

742


How to use string tokenizer class.

870


Is arraylist zero based?

797


What is a variable and constant?

789


What does += mean in java?

816


What data type is a string?

747


What is meant by singleton class?

819


What are heterogeneous objects?

819