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 consumer in java?

1073


How will you calculate the depth of a binary tree if the tree contains 15 nodes?

1137


What are 5 boolean operators?

1252


What is an 8 bit word?

1098


What java ide should I use?

1048


What is java literals?

1206


How to find the given number is a prime number or not by getting input from the user

1161


What are benefits of java?

1097


What is the difference between the paint() and repaint() methods in java programming?

1241


Which access specifier can be used with class ?

1048


Give the difference between the println method and sqrt method?

1133


Difference between a process and a program?

1161


How can we make sure main() is the last thread to finish in java program?

1256


What does snprintf return?

1057


Can you pass by reference in java?

1034