Code: Select all
//I am going to write a program to test the for loop in my studies.
class ForLoop{
public static void main(String[] args){
int x;
x=1;
for(x=1;x<5;x++);
System.out.println("value of the X is - "+x);
}
}
Code: Select all
value of the X is - 1
value of the X is - 2
value of the X is - 3
value of the X is - 4
Code: Select all
value of the X is - 5
1.)According to my idea the loop should stop in 4.right?..Then what happen here.It runs for x=5..
2.)I thought that loop will give me $ line out put.But It gave me one line..What happen there...?
Bros..I am a beginner.I am studding by you & some PFDs & you tube .So I don't know the basics also.I am analyzing others codes & try to study them..That is the way I study.....
Don't think I am a stupied..he he