i
Understanding Requirement: Why Java
Why Java is important to the Internet
Java On Linux
First Java Program
Java Virtual Machine Architecture
Class Loading Process by Class Loaders
Role Of Just In Time Compiler
Execution Engine
Data Types
Variables
Arrays
Operators
Arithmetic Operations
Shifting Operators
Logical Operators
Control Statements
Object Oriented Paradigms
The Three OOP principles
Looping Statements
JAVA Class Fundamentals
Command Line Arguments
Static Initialize
Creating an Object
Instance Variable Hiding
Overriding and Overloading of methods
Understanding The Access Controls
Nested And Inner Classes
Dynamic Method Dispatching
Abstract Classes
Using Final To Prevent Overriding & Inheritance
Garbage Collection
Defining a package
Understanding Classpath
Access Protection
Importing packages
Defining and Implementing An Interface
Abstract classes vs Interfaces
Generics
Annotations
Varargs
Foreach
Fundamentals Of Exception Handling
Types Of Exceptions
Learning exception handling, try-catch, multiple catch clauses
Nested Try Statements
Throw, Throws and Finally
Custom Exceptions
Java Thread Model
Creating A Thread
Context Switching
Synchronization: Methods And Statements
Inter-thread Communication
We have already touched one arrays few chapters before. Let’s shortly say what is array. An array is a collection of elements of one specific type in a horizontal fashion. The array in contention here is that of the one-dimensional array in Java programming.
There are few ways to declare single dimensional array:
And instantiation of array can be done with new keyword.
There is also way to declare and initialize array together at the same line:
As we have already mentioned that to traverse array we can use loop operations, let’s see an example of using different ways to print elements of array.
While working with arrays we can meet ArrayIndexOutOfBoundException. We will cover exceptions later but this happens when we try to access element of array on the index which doesn’t exists. For example, any index below 0 will cause this error or any index which is higher or equal the size of array. The first index of array is 0, and the last one is length of array - 1.
Don't miss out!