+ 1
doubt in chellange question
do{ int y=1; System.out.print(y++ +" "); }while(y<=10) why the answer is code will not compile.
2 Réponses
+ 2
Run this.
int y=1;
do{
System.out.print(y++ +" ");
}while(y<=10);
1) int y was declared and initialized inside the do so it is accessible only inside the loop or it is local to the loop. While doesn't know what y is.
2) you are missing a ; at the end of while.
0
Data + string gives string in s.o.p() argument