Follow Our FB Page << >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...

How to use scanner in java?

How to use scanner in java?..

Answer /

import java.util.Scanner;

class classname{
public methodname(){
//Scanner declaration
Scanner s_name = new Scanner(;
//Use Scanner to take input
int val = s_name.nextInt();

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is meant by 'bit masking' in java?

0 Answers   DELL,

Can you instantiate the math class in Java?

0 Answers   IBS,

how to pass the parameters to applets?

1 Answers  

Where is the singleton class used?

0 Answers   Cap Gemini,

What does business logic mean?

0 Answers  

Define iterator and methods in iterator?

0 Answers  

Explain method overloading?

0 Answers  

What restrictions are placed on method overriding?

0 Answers  

Can you sort a list in java?

0 Answers  

Differentiate between static and non-static methods in java.

0 Answers  

What is the difference between interface & abstract class?

0 Answers  

What is the use of flag?

0 Answers