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 are the rules for naming an array?

527


What is thread life cycle?

544


why Java does not support multiple inheritances?

704


What is the difference between menuitem and checkboxmenu item?

784


What is java objectoutputstream?

544






Define linked list and its features with signature?

541


Is array serializable java?

525


Is java same as core java?

589


What is equals method in java?

525


Is it possible to override the main method?

535


Can we write class inside a class in java?

553


Can static methods access instance variables in java?

577


What is the biggest integer?

555


Which method you will use to create a new file to store some log data. Each time a new log entry is necessary, write string to the file in java ?

639


Is it possible to compare various strings with the help of == operator? What are the risks involved?

621