Java Tutorial 20 - Scanner Class - Study Viral
Scanner Class exists in java.util Package.
It is used to read input from keyboard and contains many methods which helps to store that input into primitive data-types as well as for String class objects.
Java Scanner class extends Object class and implements Iterator and Closeable interfaces.
A Scanner breaks its input into tokens using a delimiter pattern, which by default matches whitespace. The resulting tokens may then be converted into values of different types using the various next methods.
public byte nextByte( )
public short nextShort( )
public int nextInt( )
public long nextLong( )
public float nextFloat( )
public double nextDouble( )
public String next( )
public String nextLine( )
www.studyviral.in
Email : info@studyviral.in
0 comments:
Post a Comment