Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

scanner.hasnext()

import java.util.*;  
public class ScannerHasNextExample1 {    
    public static void main(String args[]){       
          //Create Scanner object  
        Scanner scan = new Scanner("Hello World!");  
        //Printing the delimiter used  
        System.out.println("Delimiter:" + scan.delimiter());  
        //Print the Strings  
        while (scan.hasNext()) {  
            System.out.println(scan.next());  
        }  
        //Close the scanner  
        scan.close();  
        }    
}  
Source by www.javatpoint.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
6+5 =