java pass array as method parameter
/*
In java, you can create an array like this:
new int[]{1, 2, 3};
replace `int` with whatever you want
*/
public static void doSomething(int[] list) {
System.out.println("Something is done.");
}
public static void main(String[] args) {
doSomething(new int[]{1, 2, 3});
}
Also in Java:
- print map java
- time conversion solution
- java variables in annotations
- java program to get all cat indices in elasticsearch javadoc
- create an empty array in java
- ceil function in java
- how to open a webpage with java
- system.in example in java
- java download file from url to string
- java code to get all leaf nodes of a xml file
- arraylist with values java
- how to declare a linked list in java
- binary to int java
- java 8 collect multiple lists into single list
- how to interrupt a void java
- Unrecognized option: --version Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
- take a value from keyboard java
- fragment button nullpointerexception
- immagini java
- springBoot
- string replace last character java
- tower of hanoi program in java using recursion
- convert string to localdatetime
- java pass array as method parameter