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]
3 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]3 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
Effective resource management: a. Locks out unauthorized access and can work to prevent changes to resources by internal users n
alexgriva [62]

Answer:

c. Enables a security administrator to control user and resource access from individual machines rather than from a central location.

Explanation:

Effective resource management requires that network resources or databases be accessed securely or protected from unauthorized users. A company with an effective resource management policy like Amazon cloud services and Google cloud services allows for an administrator to Grant access to a group of users with configured individual devices.

6 0
4 years ago
What is the main piece of computer software on which every other piece of software relies?
krok68 [10]
It is
B) Operating System
8 0
4 years ago
How do you clean and maintain a mouse, keyboard, optical drive, computer display, and printers?
Varvara68 [4.7K]

Answer:

I do not know the answer to this question

4 0
3 years ago
Read 2 more answers
Ryan is looking to buy a new HDTV set. He knows from friends that LCD set screens reflect less light than plasma set screens, bu
lbvjy [14]

Answer: Cognitive

Explanation:

 According to the question, the Ryan shows cognitive attitude towards the HDTV. The cognitive component basically refers to the three main components that are:

  • Thoughts
  • Beliefs
  • Attributes

The cognitive component is one of the type of attitude which basically consist of various types of thoughts, knowledge and the beliefs towards the any type of object. It is one of the belief and opinion of the attitude.  

3 0
3 years ago
HELP MEEE PLEASE!!!
Vladimir [108]

Answer:

b goes with 1 c goes with 3 and a goes with 2

Explanation:

3 0
3 years ago
Other questions:
  • A DSLR camera is made up of two parts. They are
    13·2 answers
  • Let's say you're creating a search stream in your hootsuite dashboard, to find mentions of the phrase vacation holiday getaway.
    15·1 answer
  • Which feature of a browser will you select to block pop-ups? view help tools file
    15·2 answers
  • You learned about microcomputer a personal computer designed for use by an individual. Perform online research find out the diff
    12·1 answer
  • Which process refers to starting up a computer?
    13·2 answers
  • Your electric service has been failing with some frequency lately because of a lot of storms, and you are looking for more peace
    14·1 answer
  • 3. Matthew captures traffic on his network and notices connections using ports 20, 22, 23, and 80. Which port normally hosts a p
    14·1 answer
  • Can someone help me please and thank u
    13·2 answers
  • Computers have small bumps on the keyboards that enable persons to type without looking at the keyboard. These letters are:
    6·2 answers
  • Define computer ?what is water pollution?<br><br><br>​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!