Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

java no name 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 :: java @documented 
Java :: discount computation in java 
Java :: request.iter_content(1024 * 1024) 
Java :: Java how to handle HTTP GET request after establishing TCP connection 
Java :: java schleifendurchläufe zählen 
Java :: java code to input non blank string 
Java :: spigot wolf death message 
Java :: java i/o streams 
Java :: Custom Layout to listview 
Java :: primefaces p:dataexporter encoding for pdf 
Java :: Repeat execution of function infini android studio 
Java :: How to Register a Custom Auto-Configuration? 
Java :: place.getlatlng() returning null 
Java :: buffered reader for big integer 
Java :: exit for loop java stack overflow 
Java :: ternary search in java 
Java :: how to get value from property file in spring xml file 
Java :: javafx get listview fxml id 
Java :: masquer saisie mot de passe java console 
Java :: confirmation dialog android 
Java :: es java painless source int value increase 
Java :: java k jump 
Java :: thymeleaf Expression Object dialects 
Java :: get beginning and end of selected text in java 
Java :: minecraft java plugin shift 
Java :: how to check if parsing in integer is possible in java 
Java :: setsystemuivisibility example 
Java :: Java array with objects from different types 
Java :: kakao tech tcp close_wati 
Java :: array remove duplicate in java 
ADD CONTENT
Topic
Content
Source link
Name
2+5 =