About Question enthuware.ocpjp.v8.2.1322 :
Moderators: Site Manager, fjwalraven
-
- Posts: 7
- Joined: Fri Dec 11, 2015 6:50 am
- Contact:
About Question enthuware.ocpjp.v8.2.1322 :
"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?
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?
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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.
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.
-
- Posts: 27
- Joined: Fri Jul 22, 2016 9:14 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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.
-
- Posts: 2
- Joined: Fri Nov 04, 2016 5:27 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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
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
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
Compatibility is about execution not compilation.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
If you like our products and services, please help us by posting your review here.
-
- Posts: 56
- Joined: Tue Feb 21, 2017 4:24 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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?
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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(!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.
-
- Posts: 2
- Joined: Wed Nov 30, 2016 11:41 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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?
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 (50.39 KiB) Viewed 12742 times
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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.
-
- Posts: 2
- Joined: Wed Nov 30, 2016 11:41 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
Oops...
Thanks for helping. Sorry for inconvenience.
Thanks for helping. Sorry for inconvenience.
-
- Posts: 125
- Joined: Thu Jul 05, 2018 6:44 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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).
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).
-
- Posts: 125
- Joined: Thu Jul 05, 2018 6:44 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
These two sentences:
should instead say this:No change is required in the JVM for supporting assertions.
Assertions require 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?No change was required in the JVM for supporting assertions.
Assertions required changes at the API level.
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
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.
-
- Posts: 5
- Joined: Sat Jul 06, 2019 7:10 am
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
"Code written for JDK version 1.3 cannot be compiled under JDK version 1.4"
what does it have to do with java 8?
what does it have to do with java 8?
-
- Site Admin
- Posts: 10078
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocpjp.v8.2.1322 :
You are right. This question has now been removed from the test.
thank you for your feedback!
Paul.
thank you for your feedback!
Paul.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 16 guests