solve this is my problem byte a=40,byte b=50 both add value is 90 this is with in range of byte... byte range is -128to 127....
why this pgm gives error like type mismatch....
package javapgms;
public class byte1 {
public static void main(String args[])
{
byte a=40,b=50;
byte c=a+b;
System.out.println(c);
}
}
note : dont use int k...
a,b,c are in byte range... mind it..
Answer Posted / siva
c=(byte)(a+b);
Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Explain the init method?
What is the purpose of sizeof operator?
What is numeric function?
How do you compare two objects?
what are three ways in which a thread can enter the waiting state? Or what are different ways in which a thread can enter the waiting state? : Java thread
How to disable caching on back button of the browser?
What programs use java?
What is a generic code?
Is nullpointerexception checked or unchecked?
Explain spliterator in java8?
In a container there are 5 components. I want to display the all the components names, how will you do that one?
What checkbox method allows you to tell if a checkbox is checked?
What is string pool in java?
Explain importance of finally block in java?
Can singleton class be inherited in java?