About Question enthuware.ocpjp.v8.2.1322 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
surzhin
Posts: 7
Joined: Fri Dec 11, 2015 6:50 am
Contact:

About Question enthuware.ocpjp.v8.2.1322 :

Post by surzhin »

"Assertions can be enabled or disabled through the command line at the time of execution of the program."
By using the switches, -ea and -da or -enableassertions or -disableassertion.

Assertions can be enabled or disabled through the command line at the time of starting of the program.

Can I change the mode after the program start?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by admin »

The phrase "at the time of execution" is used in the same sense as "at the time of starting". It is like saying, "ok, execute the program now", which is same as, "ok, start the program now". It doesn't say, "during the execution", which is what you are referring to.
Anyway, I am updating the statement to make it more clear.
thank you!
Paul.
If you like our products and services, please help us by posting your review here.

badbishop
Posts: 27
Joined: Fri Jul 22, 2016 9:14 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by badbishop »

Speaking of changes the assertions require, I think it should be mentioned what is meant by "change", otherwise the question is ambiguous. If I understand it right, it is introducing assert keyword in JDK 1.4.

ja3ekja
Posts: 2
Joined: Fri Nov 04, 2016 5:27 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by ja3ekja »

I have a question about Test 2 80 question
Code written for JDK version 1.3 cannot be compiled under JDK version 1.4
what with backwards compatiblity?
Edit
All right there was no question:)
It is about NOT correct statement

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by admin »

ja3ekja wrote:I have a question about Test 2 80 question
Code written for JDK version 1.3 cannot be compiled under JDK version 1.4
what with backwards compatiblity?
Edit
All right there was no question:)
It is about NOT correct statement
Compatibility is about execution not compilation.
If you like our products and services, please help us by posting your review here.

lenalena
Posts: 56
Joined: Tue Feb 21, 2017 4:24 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by lenalena »

I don't understand why Option 1 is correct. How could assertions have been implemented without the change to the JVM? Or does all assertions-related code gets substituted with some "standard" code at compile-time?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by admin »

Yes, an assert statement basically just gets converted to an if statement -
if(!condition) throw new AssertionError(message);
There is no need for any changes to the JVM for this.

Here are the details: http://www.benf.org/other/cfr/how-is-as ... ented.html
If you like our products and services, please help us by posting your review here.

mabilalmirza
Posts: 2
Joined: Wed Nov 30, 2016 11:41 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by mabilalmirza »

Answer is confusing...

Option 1 says change required at JVM level, and comment says no change is required. This is conflicting yet this is shown correct.

Option 3 seems correct as comment says we can do whatever option says by using switches. But this is not shown correct.


Can someone explain the state (in attached image) and correct/incorrect answers?
Attachments
enthuware.ocpjp.v8.2.1322.PNG
enthuware.ocpjp.v8.2.1322.PNG (50.39 KiB) Viewed 11744 times

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by admin »

Read the problem statement carefully. It asks you to select statements that are wrong.
If you like our products and services, please help us by posting your review here.

mabilalmirza
Posts: 2
Joined: Wed Nov 30, 2016 11:41 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by mabilalmirza »

Oops...

Thanks for helping. Sorry for inconvenience.

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by __JJ__ »

Erm, how and why are we expected to know that when the assertions mechanism was brought in (in version 1.4? like over a decade ago?) that it didn't require changes at the JVM level, because they are implemented internally with some kind of preprocessor logic?

I mean, seriously, are we expected to know this?

If we are expected to know this why are we not expected to know load of other JVM spec gubbins that have no value whatsoever?

Knowing that the JVM didn't need a specification change when assertions were brought in has ZERO value. ZERO. It makes ZERO difference to how and where we are supposed to use assertions. Please, correct me if I'm wrong (I usually am, I accept that).

__JJ__
Posts: 125
Joined: Thu Jul 05, 2018 6:44 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by __JJ__ »

These two sentences:
No change is required in the JVM for supporting assertions.
Assertions require changes at the API level.
should instead say this:
No change was required in the JVM for supporting assertions.
Assertions required changes at the API level.
We are talking about something that happened many years ago, correct? I remember now why I found this question so confusing. I was thinking, WTH are they talking about?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by admin »

No, you don't need to know the dates or the version. This is just basic information about assertions.
If you like our products and services, please help us by posting your review here.

Perelun
Posts: 5
Joined: Sat Jul 06, 2019 7:10 am
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by Perelun »

"Code written for JDK version 1.3 cannot be compiled under JDK version 1.4"
what does it have to do with java 8?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocpjp.v8.2.1322 :

Post by admin »

You are right. This question has now been removed from the test.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests