Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Given a String variable email, write code using split method to print email id and domain in separate lines. Example: email -> info@yahoo.com Print: Email

Given a String variable email, write code using split method to print email id and domain in separate lines.

Example:

email -> info@yahoo.com

Print:

Email id: info

Email domain: yahoo.com

If email contains no @ character or multiple @ characters then print invalid email:

email -> hello-yahoo.com

print:

invalid email

email -> my@fancy@email.com

print:

invalid email

----------------------------------------

import java.util.*;

class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); String email = input.nextLine(); //Write your code below } }

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

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

Students also viewed these Databases questions

Question

4. Describe the role of narratives in constructing history.

Answered: 1 week ago

Question

1. Identify six different types of history.

Answered: 1 week ago