This week's book giveaway is in the Cloud forum.
We're giving away four copies of Terraform in Action and have Scott Winkler on-line!
See this thread for details.
Win a copy of Terraform in Action this week in the Cloud forum!

Aaron Ng

Greenhorn
+ Follow
since Oct 14, 2012
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Aaron Ng

Jeff Verdegan wrote:

Aaron Ng wrote:
it won't do what its suppose to do



Yes, you've mentioned that.



the test will fail and it won't return true unless i'm doing something wrong



Ah, NOW we're getting somewhere.

So, presumably you're expecting this test:

to evaluate to true, because of "SHOP AT OUR ONLINE PHARMACY", right?

Two questions:

1) Are you sure that parameter corresponds to the subject of the MailItem?

2) If it does, do you think that "SHOP AT OUR ONLINE PHARMACY".equals("Online Pharmacy") should be true? That is, do you think that "SHOP AT OUR ONLINE PHARMACY" is in fact equal to "Online Pharmacy"?

I'm hoping that this will make it clear to you what the nature of your logic error is. If it does, then your next step is to search through the docs for java.lang.String and see what methods it has that might more closely match what you're really trying to do. If you still don't understand the problem, post again.


i got it all working for that part now thanks
now the second question is how do i implement it when i tried it it says that a static content won't work on non static content
here is the code (from the MailServer Class) unless i am implementing the method in the wrong place


9 years ago

Jeff Verdegan wrote:

Aaron Ng wrote:

Steve Luke wrote:So what's the problem you are having with the code? What does it do that it isn't supposed to, or what doesn't it do that it is supposed to?



if the subject field of the item finds any of the following word it should remove it or not post it in the server but i'm not sure on how to get that to work



This doesn't add any information to your original post. In exactly what way does it not work? For example, if you provide it a MailItem with a subject of "Fake Watches", then, assuming getSubject() does what its name suggests, the method will return true, which I would expect is the correct result.

So, what exactly is the problem?



it won't do what its suppose to do like when i test it the following



the test will fail and it won't return true unless i'm doing something wrong
9 years ago

Steve Luke wrote:So what's the problem you are having with the code? What does it do that it isn't supposed to, or what doesn't it do that it is supposed to?



if the subject field of the item finds any of the following word it should remove it or not post it in the server but i'm not sure on how to get that to work
9 years ago
hello and i sort of need some help as i can't figure out on how to do it
the method checks for certain word and "marks" it as spam so it will either remove the item or it won't post it
here is the code that i'm stuck on right now many thanks

9 years ago

Rob Spoor wrote:Welcome to the Ranch!

Can you show us the error you get?



nevermind i got it working but i got another problem
when i try to post it in uppercase and send it to person it won't send it
maybe i did the coding wrong or something but the logic looked right

here are the codes





9 years ago
hello,i just registered today and i'm kind of stuck at an assignment right now
when i try to get the messages it gives me an error here is the code

this is under the class MailServer



i'm not sure if this has something to do with it but here's the code from another class known as mailClient


thanks
9 years ago