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 / guest

yes.But you have to cast that variable before adding.

eg:
byte b=(byte)b1+(byte)b2

Is This Answer Correct ?    7 Yes 35 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is default locale java?

799


Difference between Linked list and Queue?

800


These static constructors are correct ? class A { statc intA() { } static A(int x,int y) { } static A(int x) { } }

814


Can we define static methods inside interface?

737


What is nested top-level class?

780


What are the two types of streams offered by java 8?

696


What are the different types of methodologies?

768


What is type safety in java?

730


What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?

737


Objects or references which of them gets garbage collected?

735


What are the features of java?

747


How to make a class or a bean serializable?

739


Which is fastest collection in java?

769


What is the lifetime and scope of a variable?

766


What do you mean by access modifier?

789