Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Email message program b/w 2 classes  RSS feed

 
Francais Libble
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I am trying to make a program that takes the information from the main args, and displays them as a email in another class when Java is run.
Ex.
From: PersonA
To: PersonB
Email message is here

I have gotten this far, but every time I append my "email.print()" into the next class, it never can print any of the Strings.
I'm pretty new at this, appreciate any help

Main Args Class:



Secondary Class:
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Francais Libble wrote:
I have gotten this far, but every time I append my "email.print()" into the next class, it never can print any of the Strings.
I'm pretty new at this, appreciate any help


Your Message class append() method doesn't do anything that has a noticeable effect. And the print() method doesn't do anything at all.

Henry
 
Francais Libble
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Henry Wong wrote:
Francais Libble wrote:
I have gotten this far, but every time I append my "email.print()" into the next class, it never can print any of the Strings.
I'm pretty new at this, appreciate any help


Your Message class append() method doesn't do anything that has a noticeable effect. And the print() method doesn't do anything at all.

Henry

The message append is supposed to take the first 2 names out of the "new message" string. And the print() method, I am trying to input the entire text body into that method, but it doesn't work. Because the original method doesn't specify any variables or text. Sorry for the sloppy coding, I have been trying to make this work for a day now.
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Francais Libble wrote:
The message append is supposed to take the first 2 names out of the "new message" string.


Well, the append() method doesn't do that. Also, since the constructor for the Message class does not actually save the names anywhere, it won't be able to do that (or anything with the two names, after you "take" it) until you fix the constructor first.

Henry
 
Liutauras Vilda
Sheriff
Posts: 4927
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Francais Libble,
There are several different type of variables, which ones are which?
member: ?
local: ?

Whats been told about declaration of variables within blocks? What visibilities do they have?
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!