Program that accepts a String by your name

Program that accepts a String by your name

Write a Program that accepts a String by your name and display it on the screen

View Answers

July 4, 2012 at 1:32 PM

The given code accepts the name from the user and display it on the console along with message.

import java.io.*;

public class Example
{
    public static void main(String[]args){
        System.out.print("Enter Name: ");
        try{
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        String name=br.readLine();
        System.out.println("Hello "+name);
        }
        catch(Exception e){}
    }
}









Related Tutorials/Questions & Answers:
string program
string program  write a program to print the pattern p r o program r a m
string program
string program  wap to find single occurrence of given string in java without using any predefined method
Advertisements
string program
string program  reads sentence and find the average length of word... AverageLengthOfWords { public static void main(String[] args...); System.out.print("Enter sentence: "); String st=input.nextLine(); String str
Java Program MY NAME
Java Program MY NAME   Write a class that displays your first name... in the correct order to display your name... with the following name (for example, for letter A, public displayLetterA
String reverse program
String reverse program  write a java program for reverse string? if the string is "Hi welcome to hyderabad" the reverse string is "hyderabad to welcome Hi"   I hope you would have applied your logic before asking
convert string type to mathod name
a string type data to as a method name? For Ex: collTypeCatList = new ArrayList<... java.util.*; class Employee{ public int id; public String name; public String address; public Employee(){} public Employee(int id, String name,String address
Write a program in JAVA which accepts a sentence & displays the longest word in the sentence alongn with it length of the word.
Write a program in JAVA which accepts a sentence & displays the longest word in the sentence alongn with it length of the word.  **A program in JAVA which accepts a sentence & displays the longest word in the sentence along
String program - Java Beginners
String program  write a program to accept a word. Pass it to the function magic(String x). The function checks the string for the presence... prints it is a magic string otherwise it prints not a magic string.  
java string vowel program
java string vowel program  java string vowel program   Please visit the following links: Display the word that begins with vowel Java Count Vowels
String Function Program
String Function Program  The string function program is just an application of the string manipulation functions in JAVA. The program is designed to count the number of one-letter word, two-letter word, and three-letter words
Program to swap the string
Program to swap the string  Hi, can any one tell me the code to swap...!!   Here is an example that prompts the user to enter two string and then swaps both the string without using third variable. import java.util.*; class
ModuleNotFoundError: No module named 'accepts'
ModuleNotFoundError: No module named 'accepts'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'accepts' How to remove the ModuleNotFoundError: No module named 'accepts
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
A Program To Reverse Words In String in Java .
A Program To Reverse Words In String in Java .  A Program To Reverse Words In String in Java :- For Example :- Input:- Computer Software Output :- Software Computer
java program for string tokenzing and parsing
java program for string tokenzing and parsing  String s="height=128 weight=22 gender=male"; i need to convert this into height="128" weight="22" gender="male" normally if we print "hello" means we use System.out.println("\"Hello
java program for string tokenzing and parsing
java program for string tokenzing and parsing  String s="height=128 weight=22 gender=male"; i need to convert this into height="128" weight="22" gender="male" normally if we print "hello" means we use System.out.println("\"Hello
String Exception Program - JSP-Servlet
the code for your kind reference: <% int val =0; String contentType...String Exception Program  Respected Sir/Madam, I am R.Ragavendran.. I got your coding for file upload and download in JSP.. Thank you very
A Program To Reverse Words In String in Java
A Program To Reverse Words In String in Java  A Program To Reverse Words In String in Java for example: Input:- Computer Software Output... Tell Me This Program.  Here is an example that reverse the words
Controlling your program
; We all know that the execution of the statements in a program takes... flow statement. It directs the program to execute a certain section of code...; public static void main(String[] args){   
ModuleNotFoundError: No module named 'flask-accepts'
'flask-accepts' error? Thanks   Hi, In your python...ModuleNotFoundError: No module named 'flask-accepts'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named
Reverse String Program in Java
Reverse String Program in Java We are going to describe about reverse string program in java. In this example reverses a string entered by the user. We... Output- Here is the output of the program: Enter a String
Find Your Host Name
Find Your Host Name   ... the host name of the local system in a very simple example. Here we are just call...;} } The above example shows the host name of the local system. The output
Program using String functions - Java Beginners
Program using String functions  Write a program to accept a sentence... { public static void main(String[] args) { int count = 0...); System.out.print("Enter string:"); String st = input.nextLine
Java program to get domain name by URL
Java program to get domain name by URL       We can also get the domain name by the java program. Domain name are used to represent the symbolic representation
Name
Name  make a program that take a input from user in alphabet and show all the name of that character E.g User give character "B". The program shows... CharacterProgram{ public static void main(String[] args) throws Exception
accepts the area of a square and will calculate its perimeter.
accepts the area of a square and will calculate its perimeter.  Develop a program that accepts the area of a square and will calculate its perimeter...(String[] args) { DecimalFormat df = new DecimalFormat("##.00
Out of bounce exception in the string reverse program - Java Beginners
Out of bounce exception in the string reverse program  In the given program below this is taken from ur site but when i am executing it.It is giving an exception like string out of bounce.So please give me the correct solution
Overview of Networking through JAVA,Find Your Host Name
Find Your Host Name   ... the host name of the local system in a very simple example. Here we are just call...;} } The above example shows the host name of the local system. The output
string
string   just i want to a program in a short form to the given string in buffered reader for example input string: Suresh Chandra Gupta output: S. C...{ String name=br.readLine(); String nameArray
string
and also displaying that contain word? Like I want to find "a" in the string....   Here is a java example that accepts a sentence from the user and a character. It then count the occurrence of that character in the string and display
Find Your Host Name/IP Address
Find Your Host Name/IP Address   ... the getLocalHost() method to print the Host name as well as the IP Address of the local... is as under, In which the host name of the local system is Comp20 and the IP
I am writing a program which converts a string to a timestamp and add days to it
I am writing a program which converts a string to a timestamp and add days to it  java.sql.Timestamp ts2 = java.sql.Timestamp.valueOf("2012-01-11 12:34:39"); long l=ts2.getTime() +(100060602424);//add 24 days Date d=new Date(l
string
string  a java program using string function that computes your initials from your full name and display them   Please visit the following links: http://www.roseindia.net/tutorial/java/core/printInitials.html
Need help in completing a complex program; Thanks a lot for your help
Need help in completing a complex program; Thanks a lot for your help  Hi, I am currently working on one program which works in this way. 1...) It forms a string which is combination of static+dynamic content ie. the dynamic
Set Sheet Name Compressed Unicode
: setSheetName(int sheet, String name):  This method is used to set the sheet name.  setSheetName(int sheet, String name, short encoding): ...). setSheetName(int sheet, String name): This method is used to set the sheet name
string
string  a java program using string function to input any string... ArrangeStringAlphabetically { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.print("Enter string
program
program  Develop the program calculateCylinderArea, which accepts radius of the cylinder's base disk and its height and computes surface area of the cylinder
Java String Occurrence in a String
Java String Occurrence in a String       In this program you will learn how to find the occurrence of a String in another String. Here we have already taken a String
string
string  write a program to accept the string and store the reverse stream into another array and print
String
String  write a program using string it should replace 'c'char to integer number as 1 in whole source
string
string  a java program to input a string and display the string...*; import java.io.*; public class FirstLetter{ public static String capitalizeFirstLetter( String str ) { final StringTokenizer st = new StringTokenizer( str
string
string  a java program using string function and access modifiers to automate the insurance company which will have to manage the information about policy holders Data Members: 1)Policy No 2)Name of policy holder 3)Address 4
Write a java program that encrypt and decrypt some string by adding or removing 2 on each character.
Write a java program that encrypt and decrypt some string by adding or removing 2 on each character.  Write a java program that encrypt and decrypt... Your String : Mamoun Please Enter Your Choice : 1. Encryption. 2. Decrypt ion
string
string  program for String reverse and replace in c,c++,java e.g.Input:10,20,hello output:hello;20;10   Hi Friend, Try the following java...(String[] args) { String array[]=new String[5]; Scanner input
Create an HTML form login.html that accepts the username and password
Create an HTML form login.html that accepts the username and password   Create an HTML form login.html that accepts the username and password and submits to login.java servlet. Verify credentials and on success, set the username
STRING.....
STRING.....  plzz sent me d code for counting vowels in a string... gui programme
Java program to get class name without package
Java program to get class name without package ... and after then we will remove the package name with string manipulation functions... GetClassWithoutPackage Full class name =java.lang.String String C

Ads