The actual answer is supposed to be stack
and overflow
in two separate lines for input stack.overflow
; delimiter used is ".".
Nothing is shown in the output:
Scanner p = new Scanner(System.in);
p.useDelimiter(".");
System.out.println("delimiter is "+ p.delimiter());
\\this above line is producing expected output
while(p.hasNext()){
System.out.println(p.next());
}
For input stack.overflow
and delimiter "." expected output is
stack
overflow