public class TestReturn {
public static void main(
String[] args) {
Adder adder = new Adder();
byte y= adder.addAndReturn((byte)1, (byte)2); ---------> arguments casted and passing to the function
System.out.println("Added value is"+y);
}
}
class Adder{
byte addAndReturn(byte firstNum, byte secondNum){
byte t = firstNum + secondNum; -------------> this statement
return (t);
}
}
why it is showing cannot convert int to byte?