When I recently made a project, I encountered an error:
public class userjobfilteredserviceimpl implements userjobfilteredservice { //Method 1, business method, implement service layer method public void getattention (Int userid) { //This method needs to call Method 2, I use the following method to invoke, run the Times wrong UserJobFilteredServiceImpl Userjobfilteredserviceimpl = new userjobfilteredserviceimpl (); userJobFilteredServiceImpl. checkValid; //is called as follows, the result is correct UserJobFilteredServiceImpl userJobFilteredServiceImpl; userJobFilteredServiceImpl. checkValid; By the project manager saw, mercilessly criticized a meal, changed to the following this. checkValid; }; //Method 2, check method, this kind of method public void checkvalid () {};}
http://www.douban.com/note/338064780/
Java--the difference between an object reference and an object