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 Resource Leak?

2 Answers  


What does localhost mean?

0 Answers  


Can we overload destructor in java?

0 Answers  


can you create interface instance ?

54 Answers   Fidelity, TCS,


Difference between ‘>>’ and ‘>>>’ operators in java?

0 Answers  


What are the differences between the constructors and methods?

0 Answers  


what is inner class?

6 Answers   HCL,


Which one will take more memory: an int or integer?

0 Answers  


What are Font and FontMetrics classes?

1 Answers  


explain local datetime api in java8?

0 Answers  


class A{ class B{ } } in which name u save the file,its the program compile?

6 Answers   HCL,


Explain the difference between arraylist and linkedlist in java?

0 Answers  


Categories