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

Hi friends i want display Triangle shap stars(*) please can tell me any one java code logic? * *** ***** ******* Like this

2 Answers   NIIT, TCS,


What is the implementation of destroy method in java. Is it native or java code?

0 Answers  


What are the differences between heap and stack memory?

0 Answers  


what is a green thread? : Java thread

0 Answers  


What is the difference between parameters and arguments ?

2 Answers  


what is meta-Inf?

2 Answers   Polaris,


explain what is transient variable in java?

0 Answers  


Which method must be implemented by all threads?

0 Answers  


What is the use join() in Threads ?

5 Answers   HCL,


What is multithreading and its advantages?

0 Answers  


What is reverse function?

0 Answers  


Can we make a constructor final?

0 Answers  


Categories