Help Us Improve. Please let us know if you were asked any question in your interview.

More Questions

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?

Ans.java.lang.Object

Q4. What is the package name for Scanner class?

Ans.api.java.util


Stay updated with Java posts in your email.

Enter your email address:


Delivered by FeedBurner
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




×

Would like to 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.


×

Would like to try our new Java Practice Test tool.

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