MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / main

Method main

Programs/input.java:4–11  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

2
3public class MyInput {
4 public static void main(String[] args) {
5 // TODO Auto-generated method stub
6 Scanner sc = new Scanner(System.in); // create new object of the scanner class
7 int x;
8 System.out.println("Enter a number: "); // displaying a message (prompt) for the user input
9 x = sc.nextInt(); // save the user input as variable x
10 System.out.println("Number is: " + x);
11 }
12}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected