byte a=5;
byte b=5;
byte c=a+b;
System.out.println(c);
whats the o/p?
Answer Posted / amulkumar
CE:Type mismatch: cannot convert from int to byte
at byte c=a+b;
to avoid this typecast: byte c=(byte)a+b;
or
int c=a+b;
Is This Answer Correct ? | 18 Yes | 6 No |
Post New Answer View All Answers
How do I get a substring?
Why stringbuilder is not thread safe in java?
What is arraylist class in java?
What is java volatile?
Why do we need hashset in java?
Is there any way to skip finally block of exception even if some exception occurs in the exception block?
Tell me the Importent classes in net package?
Why we use set in java?
What is finally in Java?
What is meant by local variable and instance variable?
What is array pointers ?
What are static blocks in java ?
Explain spliterator in java8?
What are the benefits of immutable objects?
Explain hashset and its features?