Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / m. abhishek

yes, but u require type casting because the the binary
operation in java should atleast returns Integer values


example :
byte a=12;
byte b=23;
// byte c=a+b; //Not OK,bcoz a+b is an int value
int c=(byte)a+b; // OK

Is This Answer Correct ?    34 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we rethrow the same exception from catch handler?

1079


worst case complexities of Quick sort and Merge sort.

948


What are the special characters?

927


What is the purpose of the system class in java programming?

1005


Difference between string, stringbuffer and stringbuilder?

985


What are register variables what are the advantages?

864


What is gc()?

977


What are the types of arrays in java?

1024


What do you mean by jjs in java8?

943


Why chararray() is preferred over string to store the password?

959


What is the difference between jdk and jre?

1005


Explain about the performance aspects of core java?

995


what are the methods in object?

1085


How do I get 64 bit java?

1010


Can the garbage collection be forced by any means?

932