1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Java Program Helpers Come in Please

  1. Oct 9, 2009 #1
    Java Program Helpers Come in Please !!

    1. The problem statement, all variables and given/known data

    I am writting a program which asks the user to enter his email adress, and then prints - according to five conditions - if his address is valid or not .

    1. there should be exactly one @ in the address he enters.
    2. there should be at least one '.' after the @ but not immdetly after it
    3. '.' can not be the last character in the address.
    4. After @ there should be never two '.' in a row.
    5. The @ should not be the first one.





    3. The attempt at a solution


    The only thing I could think of is the last condition. I think I could that by using charAt(0)!= @

    And, for the remaing conditions I thought about making a new method ?
    using void so it does not return any thing, only checks

    What do you think
     
  2. jcsd
  3. Oct 9, 2009 #2
  4. Oct 9, 2009 #3
    Re: Java Program Helpers Come in Please !!

    Thanks Thomas,

    But I still have to create a new method, using void as will not return any thing
    Right?
     
  5. Oct 9, 2009 #4

    Mark44

    Staff: Mentor

    Re: Java Program Helpers Come in Please !!

    Please show us your coding attempt.
     
  6. Oct 9, 2009 #5
    Re: Java Program Helpers Come in Please !!

    Look at the examples on the website I posted. It's basically one line of code, you don't need an extra method for that.
     
  7. Oct 10, 2009 #6
    Re: Java Program Helpers Come in Please !!

    Ya, I looked at your website. But still am not sure how to do it " only one line of code "

    What understod is : I have to make 2 classess in side the main class ?

    However, still I can use methods to do it, right ?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Java Program Helpers Come in Please
  1. Java programming (Replies: 4)

  2. Java program (Replies: 3)

Loading...