×

Welcome to TagMyCode

Please login or create account to add a snippet.
1
0
 
1
Language: Java
Posted by: Wilmar Giraldo
Added: Mar 26, 2017 1:40 PM
Views: 2328
  1. import java.io.*;
  2. import java.util.Scanner;
  3.  
  4. class Scanner1 {
  5.   public static void main( String args[] ) throws IOException {
  6.     String nombre;
  7.  
  8.     System.out.print( "Introduzca su nombre (una palabra): " );  
  9.  
  10.     Scanner entrada=new Scanner(System.in);
  11.     nombre = entrada.next();
  12.  
  13.     System.out.println( "Hola, " + nombre );
  14.   }
  15. }