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

Is set ordered in java?

974


Define Multiprogramming and Multiprocessing in java.

1141


What is the covariant return type?

1085


What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?

1131


What is fundamental datatype?

989


What is the difference between notify and notifyall method?

1208


Can we increase array size dynamically in java?

941


Is empty set an element of empty set?

1101


Why is whitespace important?

1077


What is core java used for?

1114


what is the significance of listiterator in java?

1074


What is t in parametric equations?

985


Why does java not allow multiple public classes in a java file ?

4522


What does the string method compareto () do?

1055


What is pangram in java?

1010