Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

inputing number in java

import java.util.*;
class InputNum {
  
  public static void main(String args[]) {
  Scanner sc = new Scanner(System.in);
    
    System.out.print("Enter a number: "); // will ask the user to input number
    int enter = sc.nextInt(); // stores the number input
    
    // print the value by calling enter variable
    System.out.println(enter); 
  }
}
Comment

PREVIOUS NEXT
Code Example
Java :: JAVA_HOME is not defined correctly. 
Java :: java button 
Java :: display image from database in java servlet 
Java :: convert class to xml string 
Java :: how to test how many of one character is in a string java 
Java :: get date by timezone java 
Java :: first java program 
Java :: arrays.aslist.add 
Java :: shift elements in array java 
Java :: how to truncate an array in java 
Java :: anagram java program 
Java :: java load .json file 
Java :: Java Using forName() method 
Java :: object to array java 
Java :: java get cunnect date time 
Java :: android studio remove notification bar 
Java :: find if a value is in a 2d array java 
Java :: how to convert an ascii number to character in java 
Java :: java swing alert window 
Java :: slice array java 
Java :: how to read a string after an integer in java 
Java :: java check how many digits in a number 
Java :: {} when initialising arraylist java 
Java :: java reverse loop 
Java :: turn ascii into text javascriot 
Java :: print * pattern in java 
Java :: how to create a circle in java 
Java :: how to add elements to an empty array in java 
Java :: java insert into arraylist 
Java :: selenium java wait for page load 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =