• More than 1000 Questions
  • Short Tests for revision
  • New Questions added Daily
  • Search by Topic, Level, Frequency & Company
  • Actively Moderated by experienced developers

Search Java Interview Questions

Best Java Question Repository on web. Click Here

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