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

What is string in java?

0 Answers  


Does java runtime require a license?

0 Answers  


Is minecraft java edition free?

0 Answers  


What is Major and importance difference between for and foreach loop ?

0 Answers   Infosys,


What are the important features of Java 9 release?

0 Answers  


What is a literal coding?

0 Answers  


What is the purpose of using bufferedinputstream and bufferedoutputstream classes?

0 Answers  


What is serialization in java?

0 Answers  


What are the four integer types supported by java?

0 Answers  


What is the difference between access specifiers and access modifiers in java?

0 Answers  


Can we pass a primitive type by reference in java? How

0 Answers  


How can we create an immutable class in java?

0 Answers  


Categories