aspose file tools*
The moose likes Beginning Java and the fly likes solved: Customer exercise Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "solved: Customer exercise" Watch "solved: Customer exercise" New topic
Author

solved: Customer exercise

Igor Mechnikov
Ranch Hand

Joined: Feb 13, 2011
Posts: 100

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)


String knock = "\u042F \u0418\u0433\u043e\u0440\u044c";
Rahul Sudip Bose
Ranch Hand

Joined: Jan 21, 2011
Posts: 637

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.


SCJP 6. Learning more now.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: solved: Customer exercise
 
Similar Threads
Comparing instances of two different classes - HOW?
constructor problems
try this program
Boolean: valueOf() and equality doubt
Whizlabs Question on Operators&Assignments