Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method not recognised

 
Sweety S.
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic