Pages

Wednesday 30 April 2014

Scanner Example With Simple Java Code

Hello friends this is a very basic example of Scanner to use as take user input from screen using java.

Here is the code :

import java.util.Scanner;
public class GettingUserInput {

    public static void main(String[] args) {
            Scanner var = new  Scanner(System.in);
            System.out.println("You have entred : "+ var.nextLine());
    }
}


NEED ONE CLICK ON DISPLAYED ADVERTISEMENT TO CONTRIBUTE THIS BLOG

No comments:

Post a Comment