Anyone can you please let me explain about this:
class MyClass
{
public static void main(String []args)
{
final int i = 100;
byte b = i;
System.out.println(b);
}
}
If I compile & run this I am getting 100 as output
----
class MyClass
{
public static void main(String []args)
{
int i = 100;
byte b = i;
System.out.println(b);
}
}
If I compile this, I am getting compiler error.
Please explain the difference
------------------
Ch. Vijayalakshmi
class MyClass
{
public static void main(String []args)
{
final int i = 100;
byte b = i;
System.out.println(b);
}
}
If I compile & run this I am getting 100 as output
----
class MyClass
{
public static void main(String []args)
{
int i = 100;
byte b = i;
System.out.println(b);
}
}
If I compile this, I am getting compiler error.
Please explain the difference
------------------
Ch. Vijayalakshmi