This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes Method not recognised Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Method not recognised " Watch "Method not recognised " New topic
Author

Method not recognised

Sweety S.
Greenhorn

Joined: Feb 26, 2004
Posts: 9
I have 2 public classes that belong to the same package.The classes are as follows:
class Individual{
public void insertDetails(){
...does something
}
}
class Member{
Individual ibean = new Individual();
public void insertDetails(){
ibean.insertDetails();
}
}
On compilation of Member ,i get an error saying "cannot resolve symbol" at ibean.insertDetails() line. The Individual class compiles without a fuss.
I cannot understand this behaviour,plz help
Thanks in advance
Srivani Nallan
Greenhorn

Joined: Apr 11, 2003
Posts: 16
Try this
---------------
public class Individual{
public void insertDetails(){
//...does something
}
}
class Member{
Individual ibean = new Individual();
public void insertDetails(){
ibean.insertDetails();
}
}
---------------------
This compiled without any errors
 
Consider Paul's rocket mass heater.
 
subject: Method not recognised