SlideShare a Scribd company logo
Arrays
Introduction
● Arrays are dynamically created objects
● Components - These variables are called the components. All are in same
type
● An array object contains a number of variables.(empty - Array has no
elements/components)
● index (location of the component)
● length of the array
Example 1
public class Arrayxsample {
public static void main(String[] args) {
int a[] = {1};
System.out.println(a[0]);
}
}
Example 2
public class Arrayxsample {
public static void main(String[] args) {
int a[] = {1,2,3,4,5};
System.out.println(a[3]);
}
}
Example 3
public class Arrayxsample {
public static void main(String[] args) {
int [] a = {4,3};
System.out.println(a[1]);
}
}
Example 4
public class Arrayxsample {
public static void main(String[] args) {
int [] a = {"4","3"};
System.out.println(a[1]);
}
}
Example 5
public class Arrayxsample {
public static void main(String[] args) {
int [] a = {1,2};
System.out.println(a[5]);
}
}
Declaring and allocation
int intArray[]; //declaring array
intArray = new int[20]; // allocating memory to array
Example 6
public class Arrayxsample {
public static void main(String[] args) {
int a[] = new int[5];
System.out.println(a[3]);
}
}
Example 7
public class Arrayxsample {
public static void main(String[] args) {
int [] a = new int [5];
a[0]=5;
a [4]=1;
System.out.println(a[4]);
}
}
Example 8
public class Arrayxsample {
public static void main(String[] args) {
int [2] a = new int [];
System.out.println(a[1]);
}
}
Example 9
public class Arrayxsample {
public static void main(String[] args) {
int [2] a = int a [];
System.out.println(a[1]);
}
}
Example 10
public class Arrayxsample {
public static void main(String[] args) {
int [] a = new int [4];
System.out.println(a[5]);
}
}
Example 11
public class Arrayxsample {
public static void main(String[] args) {
int [] a = new int [20];
for(int i =0;i<20;i++) {
a[i]=i;
}
System.out.println(a[15]);
}
}
Example 12
public class Arrayxsample {
public static void main(String[] args) {
int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 };
System.out.println(intArray[5]);
}
}
expand this
public class Arrayxsample {
public static void main(String[] args) {
byte[] apple, orange, cake[];
int x,y[],z[];
}
}
Example 13
public class Arrayxsample {
public static void main(String[] args) {
int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 };
System.out.println(intArray.length);
}
}
Example 14
public class Arrayxsample {
public static void main(String[] args) {
int[][] intArray = {{1,2},{3,4,5}};
System.out.println(intArray[0][1]);
System.out.println(intArray[1][0]);
System.out.println(intArray[1][2]);
}
}
Example 15
public class Arrayxsample {
public static void main(String[] args) {
int[][][] intArray = {{{1,2},{3,4}},{{5},{6,7,8}},{{9},{10,11,12}}};
System.out.println(intArray[0][1][0]);
System.out.println(intArray[1][0][0]);
System.out.println(intArray[2][1][2]);
}
}
Example 16
public class Arrayxsample {
public static void main(String[] args) {
int i,j,k;
int[][][] intArray = new int[100][100][100] ;
for(i=0,j=0,k=0;(i>10 || j> 0 && k>0);i++,j=j+2,k++) {
intArray[i][j][k]= (i+j)*k;
}
System.out.println(intArray[0][0][0]);
}
}
References
• https://docs.oracle.com/javase/specs/jls/se8/html/jls-10.html
• https://docs.oracle.com/javase/10/docs/api/java/util/Arrays.html
futuretekez@gmail.com
Keep In Touch
+94765632363
@FutureteKez
@10Giants

More Related Content

What's hot

Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
Namgee Lee
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
Gil Cohen
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
Smit Parikh
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
Edureka!
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
imtiazalijoono
 
C arrays
C arraysC arrays
Two dimensional arrays
Two dimensional arraysTwo dimensional arrays
Two dimensional arrays
Neeru Mittal
 
array
array array
C# Arrays
C# ArraysC# Arrays
C# Arrays
Hock Leng PUAH
 
Multi dimensional array
Multi dimensional arrayMulti dimensional array
Multi dimensional array
Rajendran
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>
Svetlin Nakov
 
18. Java associative arrays
18. Java associative arrays18. Java associative arrays
18. Java associative arrays
Intro C# Book
 
Array
ArrayArray
Array
Anil Dutt
 
Arrays in C
Arrays in CArrays in C
Arrays in C
Kamruddin Nur
 
Array in Java
Array in JavaArray in Java
Array in Java
Shehrevar Davierwala
 
intorduction to Arrays in java
intorduction to Arrays in javaintorduction to Arrays in java
intorduction to Arrays in java
Muthukumaran Subramanian
 

What's hot (20)

Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303Numpy tutorial(final) 20160303
Numpy tutorial(final) 20160303
 
Python3 cheatsheet
Python3 cheatsheetPython3 cheatsheet
Python3 cheatsheet
 
Multidimensional array in C
Multidimensional array in CMultidimensional array in C
Multidimensional array in C
 
Arrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | EdurekaArrays In Python | Python Array Operations | Edureka
Arrays In Python | Python Array Operations | Edureka
 
Array Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional arrayArray Introduction One-dimensional array Multidimensional array
Array Introduction One-dimensional array Multidimensional array
 
C arrays
C arraysC arrays
C arrays
 
Two dimensional arrays
Two dimensional arraysTwo dimensional arrays
Two dimensional arrays
 
array
array array
array
 
C# Arrays
C# ArraysC# Arrays
C# Arrays
 
Multi dimensional array
Multi dimensional arrayMulti dimensional array
Multi dimensional array
 
Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>Java Foundations: Lists, ArrayList<T>
Java Foundations: Lists, ArrayList<T>
 
18. Java associative arrays
18. Java associative arrays18. Java associative arrays
18. Java associative arrays
 
Array lecture
Array lectureArray lecture
Array lecture
 
Array
ArrayArray
Array
 
Arrays in C
Arrays in CArrays in C
Arrays in C
 
Array in Java
Array in JavaArray in Java
Array in Java
 
Chapter 6 arrays part-1
Chapter 6   arrays part-1Chapter 6   arrays part-1
Chapter 6 arrays part-1
 
1 D Arrays in C++
1 D Arrays in C++1 D Arrays in C++
1 D Arrays in C++
 
intorduction to Arrays in java
intorduction to Arrays in javaintorduction to Arrays in java
intorduction to Arrays in java
 
Oop lecture7
Oop lecture7Oop lecture7
Oop lecture7
 

Similar to Java arrays

Java generics
Java genericsJava generics
Java generics
Hosein Zare
 
6_Array.pptx
6_Array.pptx6_Array.pptx
6_Array.pptx
shafat6712
 
final year project center in Coimbatore
final year project center in Coimbatorefinal year project center in Coimbatore
final year project center in Coimbatore
cbeproject centercoimbatore
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
BG Java EE Course
 
Generics
GenericsGenerics
Chap1 array
Chap1 arrayChap1 array
Chap1 array
raksharao
 
Arrays
ArraysArrays
Given Starter Fileimport java.util.Arrays; Encapsulates.pdf
Given Starter Fileimport java.util.Arrays;   Encapsulates.pdfGiven Starter Fileimport java.util.Arrays;   Encapsulates.pdf
Given Starter Fileimport java.util.Arrays; Encapsulates.pdf
archanaemporium
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
ishan0019
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
akkhan101
 
07+08slide.pptx
07+08slide.pptx07+08slide.pptx
07+08slide.pptx
MURADSANJOUM
 
Operators
OperatorsOperators
Operators
vvpadhu
 
Array list
Array listArray list
Array list
vishal choudhary
 
Java ppt
Java pptJava ppt
Java ppt
Rohan Gajre
 
Java Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docxJava Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docx
michael1810
 
STS4022 Exceptional_Handling
STS4022  Exceptional_HandlingSTS4022  Exceptional_Handling
STS4022 Exceptional_Handling
KeerthanaMadhavan19M
 
JDK 8
JDK 8JDK 8
Java Generics
Java GenericsJava Generics
Java Generics
jeslie
 
Object Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsObject Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ Exams
MuhammadTalha436
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
freddysarabia1
 

Similar to Java arrays (20)

Java generics
Java genericsJava generics
Java generics
 
6_Array.pptx
6_Array.pptx6_Array.pptx
6_Array.pptx
 
final year project center in Coimbatore
final year project center in Coimbatorefinal year project center in Coimbatore
final year project center in Coimbatore
 
Basic data-structures-v.1.1
Basic data-structures-v.1.1Basic data-structures-v.1.1
Basic data-structures-v.1.1
 
Generics
GenericsGenerics
Generics
 
Chap1 array
Chap1 arrayChap1 array
Chap1 array
 
Arrays
ArraysArrays
Arrays
 
Given Starter Fileimport java.util.Arrays; Encapsulates.pdf
Given Starter Fileimport java.util.Arrays;   Encapsulates.pdfGiven Starter Fileimport java.util.Arrays;   Encapsulates.pdf
Given Starter Fileimport java.util.Arrays; Encapsulates.pdf
 
Java practice programs for beginners
Java practice programs for beginnersJava practice programs for beginners
Java practice programs for beginners
 
OrderTest.javapublic class OrderTest {       Get an arra.pdf
OrderTest.javapublic class OrderTest {         Get an arra.pdfOrderTest.javapublic class OrderTest {         Get an arra.pdf
OrderTest.javapublic class OrderTest {       Get an arra.pdf
 
07+08slide.pptx
07+08slide.pptx07+08slide.pptx
07+08slide.pptx
 
Operators
OperatorsOperators
Operators
 
Array list
Array listArray list
Array list
 
Java ppt
Java pptJava ppt
Java ppt
 
Java Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docxJava Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docx
 
STS4022 Exceptional_Handling
STS4022  Exceptional_HandlingSTS4022  Exceptional_Handling
STS4022 Exceptional_Handling
 
JDK 8
JDK 8JDK 8
JDK 8
 
Java Generics
Java GenericsJava Generics
Java Generics
 
Object Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ ExamsObject Oriented Solved Practice Programs C++ Exams
Object Oriented Solved Practice Programs C++ Exams
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 

More from Maneesha Caldera

An Overview of Social media analatics
An Overview of Social media analaticsAn Overview of Social media analatics
An Overview of Social media analatics
Maneesha Caldera
 
What is the programming language you need to learn
What is the programming language you need to learnWhat is the programming language you need to learn
What is the programming language you need to learn
Maneesha Caldera
 
Java if else condition - powerpoint persentation
Java if else condition - powerpoint persentationJava if else condition - powerpoint persentation
Java if else condition - powerpoint persentation
Maneesha Caldera
 
Mobile cloud computing - Introduction
Mobile cloud computing - IntroductionMobile cloud computing - Introduction
Mobile cloud computing - Introduction
Maneesha Caldera
 
Android - Listview with source code
Android - Listview with source codeAndroid - Listview with source code
Android - Listview with source code
Maneesha Caldera
 
React js Introduction
React js IntroductionReact js Introduction
React js Introduction
Maneesha Caldera
 
Android - Values folder
Android - Values folderAndroid - Values folder
Android - Values folder
Maneesha Caldera
 
Machine Learning - Supervised learning
Machine Learning - Supervised learningMachine Learning - Supervised learning
Machine Learning - Supervised learning
Maneesha Caldera
 
C# - Windows Forms - Creating exe file
C# - Windows Forms - Creating exe fileC# - Windows Forms - Creating exe file
C# - Windows Forms - Creating exe file
Maneesha Caldera
 
C# Memory management
C# Memory managementC# Memory management
C# Memory management
Maneesha Caldera
 
C# Strings
C# StringsC# Strings
C# Strings
Maneesha Caldera
 
C# - Windows forms - lesson 2
C# - Windows forms -  lesson 2C# - Windows forms -  lesson 2
C# - Windows forms - lesson 2
Maneesha Caldera
 
C# session 01
C# session 01C# session 01
C# session 01
Maneesha Caldera
 
Node
NodeNode
Lesson 2
Lesson 2Lesson 2
Lesson 1
Lesson 1Lesson 1
Html 2
Html 2Html 2
Html 1
Html 1Html 1
Java arrays
Java arraysJava arrays
Java arrays
Maneesha Caldera
 

More from Maneesha Caldera (20)

An Overview of Social media analatics
An Overview of Social media analaticsAn Overview of Social media analatics
An Overview of Social media analatics
 
What is the programming language you need to learn
What is the programming language you need to learnWhat is the programming language you need to learn
What is the programming language you need to learn
 
Presentation
PresentationPresentation
Presentation
 
Java if else condition - powerpoint persentation
Java if else condition - powerpoint persentationJava if else condition - powerpoint persentation
Java if else condition - powerpoint persentation
 
Mobile cloud computing - Introduction
Mobile cloud computing - IntroductionMobile cloud computing - Introduction
Mobile cloud computing - Introduction
 
Android - Listview with source code
Android - Listview with source codeAndroid - Listview with source code
Android - Listview with source code
 
React js Introduction
React js IntroductionReact js Introduction
React js Introduction
 
Android - Values folder
Android - Values folderAndroid - Values folder
Android - Values folder
 
Machine Learning - Supervised learning
Machine Learning - Supervised learningMachine Learning - Supervised learning
Machine Learning - Supervised learning
 
C# - Windows Forms - Creating exe file
C# - Windows Forms - Creating exe fileC# - Windows Forms - Creating exe file
C# - Windows Forms - Creating exe file
 
C# Memory management
C# Memory managementC# Memory management
C# Memory management
 
C# Strings
C# StringsC# Strings
C# Strings
 
C# - Windows forms - lesson 2
C# - Windows forms -  lesson 2C# - Windows forms -  lesson 2
C# - Windows forms - lesson 2
 
C# session 01
C# session 01C# session 01
C# session 01
 
Node
NodeNode
Node
 
Lesson 2
Lesson 2Lesson 2
Lesson 2
 
Lesson 1
Lesson 1Lesson 1
Lesson 1
 
Html 2
Html 2Html 2
Html 2
 
Html 1
Html 1Html 1
Html 1
 
Java arrays
Java arraysJava arrays
Java arrays
 

Recently uploaded

Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
e20449
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Mind IT Systems
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 

Recently uploaded (20)

Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Graphic Design Crash Course for beginners
Graphic Design Crash Course for beginnersGraphic Design Crash Course for beginners
Graphic Design Crash Course for beginners
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 

Java arrays

  • 2. Introduction ● Arrays are dynamically created objects ● Components - These variables are called the components. All are in same type ● An array object contains a number of variables.(empty - Array has no elements/components) ● index (location of the component) ● length of the array
  • 3. Example 1 public class Arrayxsample { public static void main(String[] args) { int a[] = {1}; System.out.println(a[0]); } }
  • 4. Example 2 public class Arrayxsample { public static void main(String[] args) { int a[] = {1,2,3,4,5}; System.out.println(a[3]); } }
  • 5. Example 3 public class Arrayxsample { public static void main(String[] args) { int [] a = {4,3}; System.out.println(a[1]); } }
  • 6. Example 4 public class Arrayxsample { public static void main(String[] args) { int [] a = {"4","3"}; System.out.println(a[1]); } }
  • 7. Example 5 public class Arrayxsample { public static void main(String[] args) { int [] a = {1,2}; System.out.println(a[5]); } }
  • 8. Declaring and allocation int intArray[]; //declaring array intArray = new int[20]; // allocating memory to array
  • 9. Example 6 public class Arrayxsample { public static void main(String[] args) { int a[] = new int[5]; System.out.println(a[3]); } }
  • 10. Example 7 public class Arrayxsample { public static void main(String[] args) { int [] a = new int [5]; a[0]=5; a [4]=1; System.out.println(a[4]); } }
  • 11. Example 8 public class Arrayxsample { public static void main(String[] args) { int [2] a = new int []; System.out.println(a[1]); } }
  • 12. Example 9 public class Arrayxsample { public static void main(String[] args) { int [2] a = int a []; System.out.println(a[1]); } }
  • 13. Example 10 public class Arrayxsample { public static void main(String[] args) { int [] a = new int [4]; System.out.println(a[5]); } }
  • 14. Example 11 public class Arrayxsample { public static void main(String[] args) { int [] a = new int [20]; for(int i =0;i<20;i++) { a[i]=i; } System.out.println(a[15]); } }
  • 15. Example 12 public class Arrayxsample { public static void main(String[] args) { int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 }; System.out.println(intArray[5]); } }
  • 16. expand this public class Arrayxsample { public static void main(String[] args) { byte[] apple, orange, cake[]; int x,y[],z[]; } }
  • 17. Example 13 public class Arrayxsample { public static void main(String[] args) { int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 }; System.out.println(intArray.length); } }
  • 18. Example 14 public class Arrayxsample { public static void main(String[] args) { int[][] intArray = {{1,2},{3,4,5}}; System.out.println(intArray[0][1]); System.out.println(intArray[1][0]); System.out.println(intArray[1][2]); } }
  • 19. Example 15 public class Arrayxsample { public static void main(String[] args) { int[][][] intArray = {{{1,2},{3,4}},{{5},{6,7,8}},{{9},{10,11,12}}}; System.out.println(intArray[0][1][0]); System.out.println(intArray[1][0][0]); System.out.println(intArray[2][1][2]); } }
  • 20. Example 16 public class Arrayxsample { public static void main(String[] args) { int i,j,k; int[][][] intArray = new int[100][100][100] ; for(i=0,j=0,k=0;(i>10 || j> 0 && k>0);i++,j=j+2,k++) { intArray[i][j][k]= (i+j)*k; } System.out.println(intArray[0][0][0]); } }
  • 21.
  • 22.