Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java input string with spaces

package practise;

import java.util.Scanner;

public class scanccls {

    public static void main(String[] args) {

        System.out.println("Enter your name:"); 
        Scanner scan = new Scanner(System.in);
        String name="";

        name+=scan.nextLine();
        scan.close();

        System.out.println("Your name is :"+name); 

    }

}
Comment

PREVIOUS NEXT
Code Example
Java :: resize array in java 
Java :: get all keys from pbject javascirpt 
Java :: java new char array 
Java :: calculate time java 
Java :: java method reference 
Java :: quicksort for arraylist 
Java :: flink prometheus alert on failed jobs 
Java :: gat environment variables java 
Java :: how to display the decimal value when 0 after point android studio 
Java :: arrays.copy 2d array 
Java :: string array to stringbuilder array java 
Java :: multiplication table using while loop in java 
Java :: java set textview style 
Java :: press enter in robot java 
Java :: download File java from website 
Java :: How to efficiently reverse a linked list, in Java? 
Java :: java enum 
Java :: how to use do while loop in java 
Java :: import java.lang.Math.*; 
Java :: How to check if a string is in alphabetical order in java 
Java :: bubble sort in java 
Java :: print double without decimal java 
Java :: static import java 
Java :: java math ceil 
Java :: get date from calendar java 
Java :: java hashmap time complexity 
Java :: local date to date java 
Java :: java queue implementation 
Java :: how to create object of abstract class in java 
Java :: spring security after login redirect 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =