Hi guys i am new new to java i have my home work to be done where i declare the global variable but my variabale is changing .
Program :
main()
{
public static final double j =20;
public static final double l =5;
if (l=5)
{
for (; j<=50 ; j+=2)
{
System.out.printf("value of j is %d\n",j);
}
for (; j>=4; j-=2) // i want here the value j to be 20 ...
{
System.out.printf("value of decrement is %d\n",j);
}
}
}
its working when i intialze once again j=20 in decreament for loop ... but i want j to start from 20