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
How does queue work in java?
What is the order of arraylist in java?
What is deserialization?
What is int short for?
What is hash table in java?
what is meant by encapsulation?
What exactly is a .class file?
How do you override a private method in java?
Can a abstract class be defined without any abstract methods?
What is the difference between hashmap and hashtable in java?
What is anagram of a string?
how a programmer confirms that the data submitted has been succesfully inserted into the database(either oracle or my sql).. How a programmer confirm if there is any problem with the program he wrote for insertion... ANS:--- >executeupdate method is having boolean return type, if anything goes wrong in data insertion or data updation, it would return false. otherwise, if it successfully inserts data into the database, it would return true NOW HOW TO I CHECK IN MY DURING EXECUTION WHETHER IT RETURNS TRUE OR FALSE... WELL IT WILL DISPLAY ANY MESSAGE OR NOT
Explain the difference between the public, private, final, protected, and default modifiers?
What does += mean coding?
Explain features of interfaces in java?