1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Effectus [21]
2 years ago
15

In Java Write a program that prompts the user for a name (any String value would work for testing), and print a hello message to

the console with the input string after hello. (if the user typed 'class' then the console will display 'Hello class').
Computers and Technology
1 answer:
BabaBlast [244]2 years ago
7 0

Answer:

// program in java.

// package

import java.util.*;

// class definition

class Main

{

// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read input

Scanner scr=new Scanner(System.in);

 // ask to enter the name

System.out.print("Enter a name:");

 // read name

String name=scr.nextLine();

 // print the hello message

System.out.println("Hello "+name);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create a Scanner object to read name from user.Read name from user and assign it to variable "y_name".Then print the message Hello followed by the name.

Output:

Enter your name:Krish                                                                                                      

Hello Krish

You might be interested in
13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
8_murik_8 [283]
The answer is call waiting
4 0
3 years ago
What is the Intranet?<br>​
brilliants [131]

Answer:

a local or restricted communications network, especially a private network created using World Wide Web software.

Explanation:

8 0
3 years ago
The purpose of the ___________ is to provide sufficient notice to individuals whose personal information has been stolen so they
Ahat [919]

Answer:

California Identity Theft Statute

Explanation:

The California Identity Theft Statute, also referred to as the Penal Code 530.5 PC is a statute that clearly provides a definition of what the crime of identity theft actually is. Identity theft is a crime committed when the personal identifying information of another person is taken and used unlawfully or fraudulently. The statute further provide ample information to victims of identity theft in order to avert such occurrence or further damage.

4 0
3 years ago
If you get musicilly can your parents see
Tresset [83]
I wouldn't think so unless they have access to your phone or account. But I don't believe this is school related.
6 0
3 years ago
Read 2 more answers
The letters a, e, i, o and u are the only vowels. Write a function named vowelUseDict() takes a string t as a parameter and comp
Andru [333]

Please specify the programming language.


3 0
3 years ago
Other questions:
  • What CLI command can be issued in CentOS 7 to help you to see every "hop" that a connection makes, including all of the switches
    13·1 answer
  • You would like to search for information about storms but not tornadoes. What type of search strategy may be useful?
    10·2 answers
  • If a 120 V appliance requires 15 A to operate, what is the resistance of the appliance?
    10·1 answer
  • An electronic braille embosser that translates text from a braille keyboard to a printer:
    10·1 answer
  • Write an expression to print each price in stock_prices. Sample output with inputs: 34.62 76.30 85.05
    9·1 answer
  • Most sus color in Among Us? Red is safe I saw him scan. I'll give brainliest because why not. I'm bored.
    14·2 answers
  • Walmart store wants to compare the sales of five of its stores. Write a complete program to ask the user to enter the sales for
    12·1 answer
  • Question 1 of 10 Chase lives in Oregon but works for a company that is located in Florida. What business trend is this an exampl
    11·2 answers
  • PLEASE SOMEONE ANSWER THIS
    14·2 answers
  • Can someone write this in java? Also, does anyone know how to do Edhesive assignments?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!