Hi,
class SwitchTest{
public static void main(String args[]){
for ( var i = 0 ; i < 3 ; i++){ //1
boolean flag = false;
switch (i){ //2
flag = true; //3
}
if ( flag ) System.out.println( i );
}
}
}
Compilation error at line marked //3.
Please could you explain this error to me? According to eclipse, the error occurs on line 2.
Thank you very much in advance
About Question enthuware.ocpjp.i.v11.2.3225 :
Moderator: admin
-
- Posts: 2
- Joined: Sun Apr 19, 2020 3:56 am
- Contact:
-
- Site Admin
- Posts: 10386
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.i.v11.2.3225 :
Please compile the code from the command line using Oracle's JDK's javac.
We do not recommend IDEs while studying for certification because, among other reasons, messages generated by IDEs may be different.
We do not recommend IDEs while studying for certification because, among other reasons, messages generated by IDEs may be different.
Who is online
Users browsing this forum: No registered users and 13 guests