Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817
Moderator: admin
Dreamweaver
Posts: 32 Joined: Mon Dec 29, 2014 4:14 pm
Contact:
Post
by Dreamweaver » Sat Oct 31, 2020 10:42 am
fair enough but what if
condition is a static instance variable or I use
admin
Site Admin
Posts: 10036 Joined: Fri Sep 10, 2010 9:26 pm
Contact:
Post
by admin » Sat Oct 31, 2020 11:20 am
Not sure how that effects the question or the options. You still need to select two options from the given options.
If you like our products and services, please help us by posting your
review here .
Dreamweaver
Posts: 32 Joined: Mon Dec 29, 2014 4:14 pm
Contact:
Post
by Dreamweaver » Sun Nov 01, 2020 4:55 am
I thought that the first answer would also be correct
admin
Site Admin
Posts: 10036 Joined: Fri Sep 10, 2010 9:26 pm
Contact:
Post
by admin » Sun Nov 01, 2020 8:16 am
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.
If you like our products and services, please help us by posting your
review here .
edufin166@yahoo.com
Posts: 24 Joined: Wed Sep 28, 2022 9:41 am
Contact:
Post
by edufin166@yahoo.com » Wed Oct 05, 2022 10:55 am
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");
}
}
admin
Site Admin
Posts: 10036 Joined: Fri Sep 10, 2010 9:26 pm
Contact:
Post
by admin » Thu Oct 06, 2022 12:02 am
What is not valid?? Which option do you think is not correct?
If you like our products and services, please help us by posting your
review here .
Users browsing this forum: No registered users and 58 guests