File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

solved: Customer exercise

 
Igor Mechnikov
Ranch Hand
Posts: 100
Chrome Linux VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I hope it is ok to post this here:

Edit: I think the problem lies in that the file is called Customer as well as one of its classes.
Edit2: and so it is, changing public class Customer to public class Main works



The error is:

Exception in thread "main" java.lang.Error: Unresolved compilation problems:
isMale cannot be resolved or is not a field
isGood cannot be resolved or is not a field
name cannot be resolved or is not a field
isMale cannot be resolved or is not a field
isGood cannot be resolved or is not a field
name cannot be resolved or is not a field

at Customer.main(Customer.java:25)
 
Rahul Sudip Bose
Ranch Hand
Posts: 637
Eclipse IDE Firefox Browser Java
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have defined Customer twice as the error below indicates :


john and nicloe are instances of the outer customer class and not the inner customer.


I changed the "main" class name to GreetCustomer and got this output :



PS : thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic