This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
constructor problems
Whizlabs Question on Operators&Assignments
Comparing instances of two different classes - HOW?
Boolean: valueOf() and equality doubt
try this program