Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to use scanner in java?



How to use scanner in java?..

Answer / hrindows@gmail.com

import java.util.Scanner;

class classname{
public methodname(){
//Scanner declaration
Scanner s_name = new Scanner(System.in);
//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

Need to use public,static keywords in main function?

5 Answers  


When should we create our own custom exception classes?

0 Answers  


Why we need Finally with try? pls expain with ur example..

3 Answers   BitWise, HDFC, TCS,


What is meant by string is immutable?

0 Answers  


Explain restrictions for using anonymous inner classes?

0 Answers  


What are class types in java?

0 Answers  


did interface can implementation method ? i know its not possible but my interviewer said its possible ..but how..? any one have idea ???

7 Answers   IBM,


Why there are some null interface in java? What does it mean?

0 Answers  


Explain OOPs concept.

0 Answers   Syntel, Visa,


What is autoboxing and unboxing?

0 Answers  


Is it possible to write a regular expression to check if string is a number?

0 Answers  


Is a boolean 1 bit?

0 Answers  


Categories