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

What is a byte array?

1099


What is hashtable and explain features of hashtable?

989


what are the high-level thread states? : Java thread

1015


Should a main method be compulsorily declared in all java classes?

1065


Is java written in c?

961


What is use of static in java?

1174


Explain the importance of thread scheduler in java?

1016


What is increment in java?

962


What is an exception? difference between Checked and Unchecked exception in Java

1012


What is the ==?

887


Can we restart a thread already started in java?

1103


What do you mean by exception handling in Java?

1295


Does java runtime require a license?

1068


Is minecraft 1.15 out?

977


Explain about fail fast iterators in java?

1060