how to get array input in java
Java
public class TakingInput {
public static void main(String[] args) {
Scanner s=new Scanner(System.in);
System.out.println("enter number of elements");
int n=s.nextInt();
int arr[]=new int[n];
System.out.println("enter elements");
for(int i=0;i<n;i++){//for reading array
arr[i]=s.nextInt();
}
for(int i: arr){ //for printing array
System.out.println(i);
}
}
}
Also in Java:
- Title
- java catch multiple exceptions
- Category
- Java
- Title
- random java
- Category
- Java
- Title
- java display message
- Category
- Java
- Title
- how to print to the console in java
- Category
- Java
- Title
- guess the number java
- Category
- Java
- Title
- java pass arraylist by value
- Category
- Java
- Title
- how to input in java
- Category
- Java
- Title
- java mockito any string import
- Category
- Java
- Title
- create java windows application
- Category
- Java
- Title
- read integer input java
- Category
- Java
- Title
- how to get a user input in java
- Category
- Java
- Title
- java projects
- Category
- Java
- Title
- how to get all of the chldren of a panel in java
- Category
- Java
- Title
- check if string is null or empty java
- Category
- Java
- Title
- java how to read a text file
- Category
- Java
- Title
- exponents java
- Category
- Java
- Title
- partial view tiles spring
- Category
- Java
- Title
- capcitor FERR_CLEARTEXT_NOT_PERMITTED
- Category
- Java
- Title
- convert string to int java
- Category
- Java
- Title
- java script zip function
- Category
- Java
- Title
- java how to initialize an array
- Category
- Java
- Title
- generate objects with for loop java
- Category
- Java
- Title
- big integer java
- Category
- Java
- Title
- java find duplicates in array
- Category
- Java
- Title
- java obtain list string from list object
- Category
- Java
- Title
- if statement java
- Category
- Java
- Title
- how to crate a list in java script
- Category
- Java
- Title
- java get first char
- Category
- Java
- Title
- how to show the hex detail of a file in java
- Category
- Java
- Title
- bracket balancing program in java
- Category
- Java
- Title
- pass list to intent in android java
- Category
- Java
- Title
- java read string input
- Category
- Java
- Title
- java cast duration to long
- Category
- Java
- Title
- java random seed
- Category
- Java
- Title
- how to create a Rectangle in java
- Category
- Java
- Title
- set preference value android
- Category
- Java
- Title
- double round java integer
- Category
- Java
- Title
- java vs python
- Category
- Java
- Title
- récupérer les données d un liste java
- Category
- Java
- Title
- check if a string is a substring of another string java
- Category
- Java
- Title
- @fortawesome/free-solid-svg-icons
- Category
- Java
- Title
- how to take space separated input in java
- Category
- Java
- Title
- print map java
- Category
- Java
- Title
- android switch on change
- Category
- Java
- Title
- add element to stack java
- Category
- Java
- Title
- java random boolean
- Category
- Java
- Title
- get value textfield java
- Category
- Java
- Title
- ndroid.support.v4.content.FileProvider
- Category
- Java
- Title
- how to create a JFrame in java
- Category
- Java
- Title
- iterate through an arraylist java
- Category
- Java
- Title
- arraylist java methds
- Category
- Java
- Title
- how to fill a 2d array in java
- Category
- Java
- Title
- how to find length of array in java
- Category
- Java
- Title
- java random number
- Category
- Java
- Title
- raise number to power java
- Category
- Java
- Title
- java fx display simple rectangle
- Category
- Java
- Title
- logging in java
- Category
- Java
- Title
- how to use the this keyword in java
- Category
- Java
- Title
- sign flutter app android studio
- Category
- Java
- Title
- java comparable
- Category
- Java
- Title
- processing audio android
- Category
- Java
- Title
- replaceall in java
- Category
- Java
- Title
- java how to stop code
- Category
- Java
- Title
- java print type of object
- Category
- Java
- Title
- math max java
- Category
- Java
- Title
- Java loop throug gson JsonElement
- Category
- Java
- Title
- java parse xml string
- Category
- Java
- Title
- gravity in java
- Category
- Java
- Title
- java 8 collect multiple lists into single list
- Category
- Java
- Title
- android notification addaction example
- Category
- Java
- Title
- Java nested array hashcode
- Category
- Java
- Title
- Removing DOM nodes when traversing a NodeList
- Category
- Java
- Title
- how to make int array java android
- Category
- Java
- Title
- java read file from command line argument
- Category
- Java
- Title
- Java.awt graphics tutorial
- Category
- Java
- Title
- how to make generic arraylist in java
- Category
- Java
- Title
- html redirect
- Category
- Java
- Title
- fibonacci sequence in java recursion
- Category
- Java
- Title
- java string to uuid
- Category
- Java
- Title
- remove space string java
- Category
- Java
- Title
- Fab to CircularRevealFrameLayout example
- Category
- Java
- Title
- D/NetworkSecurityConfig: No Network Security Config specified, using platform default
- Category
- Java
- Title
- declare String in java
- Category
- Java
- Title
- java iterate through map
- Category
- Java
- Title
- javafx textarea size
- Category
- Java
- Title
- méthode retourne nom classe java
- Category
- Java
- Title
- displaying an arraylist in java
- Category
- Java
- Title
- java copy array
- Category
- Java
- Title
- convert string into unicode java
- Category
- Java
- Title
- try block in java
- Category
- Java
- Title
- java 8 stream group by example
- Category
- Java
- Title
- java permutation
- Category
- Java
- Title
- java replaceall single character
- Category
- Java
- Title
- java loop hashmap
- Category
- Java
- Title
- java jagged array days and months
- Category
- Java
- Title
- how to initialize an array in java
- Category
- Java
- Title
- int to long java
- Category
- Java
- Title
- get number of items in arraylist java
- Category
- Java
- Title
- how to access private vairable in java method
- Category
- Java
- Title
- read csv java android
- Category
- Java