Hi all ranches,
Hope everyBudy fine Doing well in
java. I was Shoked to c tht final variables are very powerfull (as long as they r compiled time Constant).just Check this out.
Class A
{
public static void main(
String [] args)
{
final int F=10;
byte b=F;//will compile as F is a compile time constant
}
}
Opposite
Class A
{
public static void main(String [] args)
{
final int F=a();
byte b=F;//not compile as F is a not a compile time Constant
}
static int a()
{
return 1;
}
}
I can Say one Thing for Sure :-
JAVA is a Deep as OCEAN.