Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java anonmyous array eg


public class Main
{
	public static void main(String[] args) {
		sum(new int[] {2,4,6,8,10});
      //we can't define size of anonymous array
		
	}
	
	static void sum(int[] arr){
	 int sum=0;
	 for(int i:arr){
	     sum+=i;
	 }
	 System.out.println(sum);
	   
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: jaccard index two vectors R 
Java :: build libgdx jar 
Java :: frame background changing in java 
Java :: MyLinkedList 
Java :: get max of array java 
Java :: System.out.println("j= 6"); 
Java :: deifine an integer array in java 
Java :: java android build secret keys 
Java :: java do while loop example 
Java :: infinite value total 
Java :: linked list vs array list vs vector 
Java :: android java change text value 
Java :: java unique queue 
Java :: how to create a subclass in java 
Java :: horizontal recyclerview item width half of screen android 
Java :: selenium drag slider 
Java :: reader from string java 
Java :: protobuf java gradle mvn 
Java :: what is static method in oop 
Java :: vue input pre initial value 
Java :: java zahlen runden auf 1 nachkommastelle 
Java :: inheritance in java 
Java :: android send fragment context 
Java :: can the method local inner class object access method local variables 
Java :: java double to string fixed precision 
Java :: what is a float java 
Java :: sort java array 
Java :: garbage collection in java 
Java :: java multi thread 
Java :: java finally block 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =