About Question enthuware.ocajp.i.v7.2.1134 :
Moderators: Site Manager, fjwalraven
-
- Posts: 2
- Joined: Fri Dec 20, 2013 10:59 am
- Contact:
About Question enthuware.ocajp.i.v7.2.1134 :
I'm unsure of how this is a correct answer:
String s = this.toString();
Instance members can refer to 'this' before the instance is created?
String s = this.toString();
Instance members can refer to 'this' before the instance is created?
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1134 :
http://docs.oracle.com/javase/specs/jls ... jls-15.8.3
Paul.
HTH,The keyword this may be used only in the body of an instance method, instance initializer, or constructor, or in the initializer of an instance variable of a class. If it appears anywhere else, a compile-time error occurs.
Paul.
-
- Posts: 3
- Joined: Fri Nov 01, 2024 10:04 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1134 :
var a1 = new ArrayList<>();
this answer is not correct due the fact thar var is not allowed when defining an instance field.
this answer is not correct due the fact thar var is not allowed when defining an instance field.
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1134 :
You are right but I am unable to find this option in this question. Can you please post a screenshot of the complete question showing the full question id? Also, please mention the exam question bank that are you using.
-
- Posts: 3
- Joined: Fri Nov 01, 2024 10:04 am
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1134 :
I attached two screenshots showing the correct answers and the question bank information (i'm using last version):
QuestionID: enthuware.ocpjp.v21.2.3220
QuestionID: enthuware.ocpjp.v21.2.3220
- Attachments
-
- capt_ver.png (26.11 KiB) Viewed 27315 times
-
- capt_.png (55.86 KiB) Viewed 27315 times
-
- Site Admin
- Posts: 10384
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1134 :
Got it.
thank you for your feedback!
thank you for your feedback!
-
- Posts: 3
- Joined: Fri Nov 01, 2024 10:04 am
- Contact:
Who is online
Users browsing this forum: No registered users and 7 guests