Hi,
This question is from tipsmart.com's quiz.(25)
Q25.What will be the outcome of executing following code.
class MyClass
{
public static void main(
String []args)
{
final int i = 100;
byte b = i;
System.out.println(b);
}
}
Will give compilation error
Will compile and print 100
Will throw an exception
SKIP THE QUESTION
Answer is compile and print 100.
My question is when we assign an integer to byte don't we get an error?
Vanitha.
[This message has been edited by Vanitha Sugumaran (edited May 30, 2001).]