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

Why Java doesn’t support multiple inheritance?

1087


What is primitive array?

944


Can a final variable be null?

1060


What does percent mean in java?

1075


How does compareto method work?

1021


What is skeleton and stub? What is the purpose of those?

1192


Define max and min heap, also the search time of heap.

1075


What Is Query Throttling in java?

1045


how can i use a nonsynchronized hashtable?

2624


What is the core java?

1004


Explain about the performance aspects of core java?

1109


Can we write a class without main method in java?

999


Why singleton pattern is better than creating singleton class with static instance?

1054


What is a java applet? What is an interface?

1138


What is maximum size of arraylist in java?

1087