Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a java method, for a given string, test whether it is a valid email address or not. Assume that a valid email address satisfying

Write a java method, for a given string, test whether it is a valid email address or not. Assume that a valid email address satisfying the following conditions:

(1) The string should contain exactly one @ symbol.

(2) The string should contain at least one dot (.) symbol.

(3) There are some letters before @, that is, @ is not the first letter of the string.

(4) There are some letters between @ and .

(5) The string ends in one of the following: .com, .edu, .gov, .org, or .us

In main method, call the above method to test whether the following strings are valid email format or not.

t2@yahoo.com a@oldwes tbury.edu c@.edu c.@ny.gov a@abc.us c@.redcross.org

firstname.lastname@abc.com.us

@abc.com

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions