Which is the Best Java Web Framework ?

Java - IO - Interview Questions and Answers on Scanner

Q1.  What is Scanner class used for ? when was it introduced in Java ?

Ans. Scanner class introduced in Java 1.5 for reading Data Stream from the imput device. Previously we used to write code to read a input using DataInputStream. After reading the stream , we can convert into respective data type using in.next() as String ,in.nextInt() as integer, in.nextDouble() as Double etc 

Q2. Which interfaces are implemented by Scanner?

Ans.[, Closeable, AutoCloseable, Iterator<String>]

Q3. Which is the Parent Class of Scanner class?


Q4. What is the package name for Scanner class?


Subscribe to Java News and Posts. Get latest updates and posts on Java from Buggybread.com
Enter your email address:
Delivered by FeedBurner
comments powered by Disqus


Try our new Java Interview Questions Search Tool.

There are more than 1000 questions with practice tests.

It's updated daily and It's Awesome.


Try our new Java Practice Test tool.

There are more than 200 questions and expanding quickly. It's updated daily and It's Awesome.