Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Program that accepts a String by your name
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


ved prakash
Program that accepts a String by your name
1 Answer(s)      2 years and 6 months ago
Posted in : Java Beginners


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


Advertisement
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:
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
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
Advertisements
string program
string program  write a program to print the pattern p r o program r a m
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
string program
string program  wap to find single occurrence of given string in java without using any predefined method
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
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...;void main(String[] args){   int a = 20;  
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
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 of the above
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
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 of the above
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
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... java.text.*; class PerimeterOfSquare{ public static void main(String[] args
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
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
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
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
I want to change my user name on your website ,how can i do this
I want to change my user name on your website ,how can i do this  I want to change my user name on your website ,how can i do this   You can create another account very easily with different username
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... of the program: Enter a String Roseindia technology
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..., In which the host name of the local system is Comp20 and the IP address
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
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
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
Advertisements
 

 

 

DMCA.com