Page 1 of 1
About Question enthuware.ocajp.i.v8.2.1418 :
Posted: Sat Oct 31, 2020 10:42 am
by Dreamweaver
fair enough but what if
condition is a static instance variable or I use
Re: About Question enthuware.ocajp.i.v8.2.1418 :
Posted: Sat Oct 31, 2020 11:20 am
by admin
Not sure how that effects the question or the options. You still need to select two options from the given options.
Re: About Question enthuware.ocajp.i.v8.2.1418 :
Posted: Sun Nov 01, 2020 4:55 am
by Dreamweaver
I thought that the first answer would also be correct
Re: About Question enthuware.ocajp.i.v8.2.1418 :
Posted: Sun Nov 01, 2020 8:16 am
by admin
Ok, I see your point.
But you have to go with the general assumptions about the code appearing in the exam questions. You can only assume that everything not shown in the given code (i.e. the context) does not affect the working on the given code. So, you don't have to over think about what might be present outside the given code. The only thing that exists is appropriate imports and a valid class/method.
Re: About Question enthuware.ocajp.i.v8.2.1418 :
Posted: Wed Oct 05, 2022 10:55 am
by edufin166@yahoo.com
For JAva 17, it does not valid anymore.. the code below compile..
Code: Select all
for (long l = 1L; l < 4000000000000L; l++) {
System.out.println("\n");
switch ("test" + l) {
case "test1":
System.out.println(text + "long 1");
break;
case "test2":
System.out.println(text + "long 2");
case "test3":
System.out.println(text + "long 3");
break;
default:
System.out.println(text + "long Others");
}
}
Re: About Question enthuware.ocajp.i.v8.2.1418 :
Posted: Thu Oct 06, 2022 12:02 am
by admin
What is not valid?? Which option do you think is not correct?