How to call a class from another class

D

dlittlebear

I do not know if I am saying that correctly. This is a school
project, I do not know how to get data from 2 different files called
Client.java and Attorney.java, both having data pulled in by
LawFirm.java

The actual project is

CASE PROJECT

HOWARD, FINE, and HOWARD

The law firm of Howard, Fine, and Howard want to develop two classes
-- a Client class that hows data about the firm's clients, and an
Attorney class that hows data about each of the attorneys who works
for the firm. Client data includes a client number, last name, first
name, primary attorney's ID number, and balance owed to the firm.
Attorney data includes an ID number, last name, first name, and annual
salary. Each class includes public get and set instance methods for
accessing the data. Create an application that instantiates five
Clients and two Attorneys, assigns appropriate values to their data
fields, and displays the values in an attractive format. Save the
files as Client.java, Attorney.java and LawFirm.java.
 
E

Eric Sosman

I do not know if I am saying that correctly. This is a school
project, I do not know how to get data from 2 different files called
Client.java and Attorney.java, both having data pulled in by
LawFirm.java

The actual project is

CASE PROJECT

HOWARD, FINE, and HOWARD

The law firm of Howard, Fine, and Howard want to develop two classes
-- a Client class that hows data about the firm's clients, and an
Attorney class that hows data about each of the attorneys who works
for the firm. Client data includes a client number, last name, first
name, primary attorney's ID number, and balance owed to the firm.
Attorney data includes an ID number, last name, first name, and annual
salary. Each class includes public get and set instance methods for
accessing the data. Create an application that instantiates five
Clients and two Attorneys, assigns appropriate values to their data
fields, and displays the values in an attractive format. Save the
files as Client.java, Attorney.java and LawFirm.java.

You've described the assignment, but not the difficulty
you're having with it. What have you accomplished thus far,
and what is your question about how to continue?
 
A

Andrew Thompson

You do seem to be saying it 'too much'*.
....
You've described the assignment, but not the difficulty
you're having with it. What have you accomplished thus far,
and what is your question about how to continue?

* The OP also multi-posted this question to c.l.j.help.
Please do not multi-post in future.
<http://www.physci.org/codes/javafaq.html#xpost>

Note that you already have something approaching
a technical (start to an) answer on the other group,
a group known for being very gentle towards people
who are learning java (or new to usenet).

This group is better suited to techcical experts, and
people who already understand how to ask 'smart
questions'.
 
L

Lew

Andrew said:
* The OP also multi-posted this question to c.l.j.help.
Please do not multi-post in future.
<http://www.physci.org/codes/javafaq.html#xpost>

Note that you already have something approaching
a technical (start to an) answer on the other group,
a group known for being very gentle towards people
who are learning java (or new to usenet).

This group is better suited to techcical experts, and
people who already understand how to ask 'smart
questions'.

Yeah, and I went and jumped in with an answer on that other thread, too.

Multiposting frustrates the people who are most likely to attempt to help. I
remember another poster in these groups who adamantly refused to acknowledge a
post made in another newsgroup on the same topic, asserting that if it was in
a different group it was really in a separate thread and that he shouldn't
have to be responsible for following the conversation across those different
groups. I believe he took it to a snarky extreme, but it indicates how people
can sometimes get over multiposting. (No, it wasn't Andrew.)

Anyway, I hope my response in the other group turns out useful for the OP.
 
L

Lew

Daniel said:
Sorry, but this made me literally LOL.

Actually I was a little sorry that I said it, as it's very unfair to Andrew.

Yes, Andrew is infamous for guiding people through the shoals of multiposting
and SSCCEs, but he always does it in context of teaching the poster about
these matters. He has never, and as far as I can tell, would never cop an
attitude of "I shouldn't have to read it" about messages in other
newsgroup(s), only that the OPs need to learn and correct.

OTOH, I knew that playing to his reputation about multiposting (and mine, too,
natch) would carry humor, albeit at Andrew's expense.

Andrew, it's all in fun. I respect your work and your advice, as you know,
and I am against multiposting also. Please accept my apology if in any way I
offended you by doing this.
 
A

Andrew Thompson

Lew said:
Actually I was a little sorry that I said it, as it's very unfair to Andrew.

It's cool - it made me laugh as well. :)

I know you well enough to understand that was
meant in a purely instructive sense. Futher,
people *might* have been wonderring.

Besides, don't forget I'm Aussie! You'd need an insult
the size of Ayer's Rock (now known, again, as Uluru)
to even get an Ocker to realise that they are *being*
insulted.

Keep fighting the good fight, use my name as you
see fit..
 
E

Eric Sosman

Andrew said:
[...]
Besides, don't forget I'm Aussie! [...]

Is it true you really "are" an Aussie? Or do you
just encapsulate an Aussie, or possibly implement one?
(Jokes about "private members" and "extends" are strictly
forbidden to avoid offending the innocent.)
 
T

Twisted

Andrew said:
[...]
Besides, don't forget I'm Aussie! [...]

Is it true you really "are" an Aussie? Or do you
just encapsulate an Aussie, or possibly implement one?
(Jokes about "private members" and "extends" are strictly
forbidden to avoid offending the innocent.)

Don't forget to use "protected"! It wouldn't do to catch a nasty
virus, although you should still scan regularly with AVG just to be
safe.

Also be sure to read the design pattern book when you get bored enough
to need more elaborate arrangements. There's plenty of patterns --
even patterns involving three classes, and patterns involving more;
three-class patterns where all three or only two pairs directly
interface; and of course a good patterns book is fully illustrated
with dozens of juicy UML diagrams of every possible contortion ...

Eventually you may also need to concern yourself with the inheritance
hierarchy -- especially if you failed to use "protected" a time or
two.
 
A

Andrew Thompson

Eric said:
[...]
Besides, don't forget I'm Aussie! [...]

Is it true you really "are" an Aussie? Or do you
just encapsulate an Aussie, or possibly implement one?

Actually, more a 'partial implementation'.

I implement
Aussie.getSenseOfHumor()
Aussie.extractUrine(); // an entirely different level of 'funny' to mere
'humor'

..but provide 'do nothing' methods for..
Aussie.betSenselessAmountsOfMoneyOnAnythingThatMoves()
..and..
Aussie.treatSportAsThoughItWereTHEMostImporantThingInExistence()
(Jokes about "private members" and "extends" are strictly
forbidden to avoid offending the innocent.)

Innocent? (looks around) Let /them/ use 'net nanny'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,169
Latest member
ArturoOlne
Top