Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Char in scanner

// Java program to read character using Scanner 
// class
import java.util.Scanner;
public class ScannerDemo1
{
    public static void main(String[] args)
    {
        // Declare the object and initialize with
        // predefined standard input object
        Scanner sc = new Scanner(System.in);
   
        // Character input
        char c = sc.next().charAt(0);
   
        // Print the read value
        System.out.println("c = "+c);
    }
}
Comment

PREVIOUS NEXT
Code Example
Java :: print * pattern in java 
Java :: android push notification icon 
Java :: java join list as string 
Java :: how to add to a file in java 
Java :: reverse string using recursion java with explanation 
Java :: export java home 
Java :: android use attribute color programmatically 
Java :: print the list in java 
Java :: String by byte array in java 
Java :: how to resize image in android programmatically 
Java :: execute code after delay java 
Java :: sorting the characters in a String in java 
Java :: SendKeys issues with numbers(Int) 
Java :: loop java 
Java :: how to read file from assets folder in android 
Java :: qr code generator in java 
Java :: how to read input in java 
Java :: wait random time java 
Java :: input char java 
Java :: copy array in java 
Java :: jsp get query parameter 
Java :: get average of all the array items android 
Java :: printing prime numbers in java 
Java :: java split string by length 
Java :: Who is James Gosling 
Java :: transformer un string en double java 
Java :: convert arraylist to csv file java 
Java :: Index through 2d array 
Java :: int array java 
Java :: No Java executable found in current PATH: /bin:/usr/bin:/sbin:/usr/sbin 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =