Java Program Helpers Come in Please

In summary, The conversation discusses creating a Java program that checks for the validity of an email address entered by the user. The program must meet five conditions, including the presence of exactly one "@" symbol, at least one "." after the "@", and no consecutive "." after the "@". The use of regular expressions is suggested as a solution, and it is possible to complete the task in one line of code without the need for additional methods.
  • #1
remaan
132
0
Java Program Helpers Come in Please !

Homework Statement



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.





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 remaining conditions I thought about making a new method ?
using void so it does not return any thing, only checks

What do you think
 
Physics news on Phys.org
  • #3


Thanks Thomas,

But I still have to create a new method, using void as will not return any thing
Right?
 
  • #5


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.
 
  • #6


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 ?
 

1. What is "Java Program Helpers Come in Please"?

"Java Program Helpers Come in Please" is a phrase used to request assistance or support with a Java program. It is often used when someone is stuck or needs help with a specific problem in their Java code.

2. Who are Java Program Helpers?

Java Program Helpers can refer to anyone who is knowledgeable and experienced in using Java programming language. They can be professional programmers, teachers, or even peers who are skilled in Java.

3. How can I find a Java Program Helper?

There are several ways to find a Java Program Helper. You can ask for recommendations from friends or colleagues, search online for programming forums or communities, or attend coding workshops or classes where you can meet and network with other programmers.

4. Is it necessary to have a Java Program Helper?

Having a Java Program Helper is not a requirement, but it can be beneficial in certain situations. If you are new to Java or facing a complex problem, a helper can provide valuable guidance and save you time and effort.

5. How can I become a Java Program Helper?

Becoming a Java Program Helper requires a strong understanding and proficiency in Java programming. You can improve your skills by practicing regularly, learning from experienced programmers, and staying updated with the latest developments in the language. You can also offer to help others with their Java programs to gain experience and build your reputation as a helper.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
7
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
10
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
6K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
12K
  • Programming and Computer Science
Replies
14
Views
3K
  • Programming and Computer Science
Replies
11
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
Back
Top