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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the difference between future and callable interface in java?

1146


What are use cases?

905


How do you check whether the list is empty or not in java?

921


What is the difference between procedural and object-oriented programs?

927


What is foreach loop in java?

959


What’s the difference between constructors and other methods?

933


What is the java project architecture?

2185


Can we have try block without catch block?

985


What does it mean to be immutable?

919


What is the purpose of the system class in java programming?

1005


How do you declare an array in java?

983


How do you identify if jvm is 32-bit or 64-bit from java program?

910


What is difference between ++ I and I ++ in java?

910


Does java runtime require a license?

980


What are java packages? What is the significance of packages?

955