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?
About Question enthuware.ocajp.i.v7.2.1134 :
Moderator: admin
-
- Posts: 2
- Joined: Fri Dec 20, 2013 10:59 am
- Contact:
-
- Site Admin
- Posts: 10066
- 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.
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 222 guests