byte a=5;
byte b=5;
byte c=a+b;
System.out.println(c);
whats the o/p?

Answer Posted / dinesh kumar

compilation fails
possibl;e loss of precision, because
ie type mismatch error from byte to int, instead of byte we
can replace int(before a+b), it will excuite succesfully

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is vector thread safe in java?

562


Which eclipse is best for java?

527


What is immutable in java?

547


Tell me a few examples of final classes defined in Java API?

569


What is derived datatype?

631






Is java jre still free?

538


What is an exception in java?

648


What are classloaders?

600


Can we convert stringbuilder to string in java?

562


What are latest features introduced with java 8?

594


Give us the name of the list layoutmanagers in java?

524


Explain about the main() method in java?

570


Which of the following classes will have more memory allocated?

587


Write a method to check if input string is palindrome?

585


How we can generate random numbers in java?

612