i am so confused. i am trying to get the below code to work but it does'nt . I have two classes in two different .java files one called simpleemail and 1 called simpleemailtester. the simpleemailshould transfer the values of the input to the corresponding class attributes. but it's not working here is the code below can n e 1 help
Code:
public class SimpleEmailTest
{
public static void main( String[] args )
{
SimpleEmail Email; // email object to test.
String whoFrom; // sender
String whoTo; // recipient
String subject; // subject matter
String content; // text content of email
public static final String notKnown = "Unknown";
email = new SimpleEmail(notKnown, notKnown, notKnown, notKnown);
email.setSender( "Suresh Testsender");
email.setRecipient( "Suresh1 Receiver");
email.setSubject( "How are you today?");
email.setContent( "I just wrote an email class!");
simple email compiles just fine but here are the errors i get when compiling simpleemailtest. can n e 1 help
Code:
--------------------Configuration: JDK version 1.1.8 <Default>--------------------
C:\Program Files\Xinox Software\JCreator LE\MyProjects\SimpleEmailTest.java:12: '}' expected.
String content; // text content of email
^
C:\Program Files\Xinox Software\JCreator LE\MyProjects\SimpleEmailTest.java:14: Statement expected.
public static final String notKnown = "Unknown";
^
C:\Program Files\Xinox Software\JCreator LE\MyProjects\SimpleEmailTest.java:16: Identifier expected.
email = new SimpleEmail(notKnown, notKnown, notKnown, notKnown);
^
3 errors
Process completed.
[ArchAngel added CODE tags]
11-15-2003, 11:33 AM
Warped Noodle
Just two small things should fix you up.
First, in your main, you've got the variable "SimpleEmail Email" but throughout your code you've changed it to "email". You're using a small "e" instead of a capital.
Second, you've got the string notKnown declared as "public static final". The only modifier you would want here is final, not public or static.