× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Not a problem at all. While I feel I understand how Java works (for the most
part) and I can write classes to do all kinds of this, I lack in the
understanding of how it should be done more than how to do it.

I think part of my problem is I look for examples and here is what I get.

public class Person {
private String firstName;
private String lastName;

public Person() {
firstName = "";
lastName = "";
}

public String getFirstName() {
return firstName;
}

public void setFirstName(String firstName) {
this.firstName = firstName;
}

...
}

From what it sounds like ideally you don't want to do that. You want a class
that knows about a Person, but for most classes the just need to know it's a
Person and not a Dog. So generally speaking public getters and setters
should not be there. This is obviously not true 100% of the time, but I
think that's what is supposed to happen.

You are correct, there is no reference to polymorphism, but I have an old
copy of Thinking In Java that's pretty good. I suppose most of the concepts
are still the same. I think I'll have to read that chapter this weekend. I
might have one of those, "Oh.... ...I get it moments". That's usually what
happens to be, just wake up one day and finally get it :-)

--
James R. Perkins

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.