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

Explain different forms of polymorphism?

642


What is the advantage of functional interface in java 8?

511


What is static class

608


Is array size fixed in java?

528


I want to print “hello” even before main is executed. How will you acheive that?

646






How many types of the indexof method are there for strings?

481


What is the difference between member variables initialization and assignment in a constructor?

651


What is the concept of multithreading?

512


What is void class in java?

514


What is meant by final class?

554


We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.

1478


How do you reverse a word in java?

521


Why does it take so much time to access an applet having swing components the first time?

1384


How to sort a collection of custom Objects in Java?

585


What does  mean in regex?

562