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
There are couple of ways of extracting characters from string. To extract single character from String we should use charAt(int index) method. But if we pass an index which is less than 0 or greater or equal than the size of string (amount of characters) we will get ArrayIndexOutOfBoundExceotion.
If we want to extract not only one character but the sequence of characters we should use getChars() method:
Here first (stringStart) and second (stringEnd ) parameters of methods are the starting and ending index of the substring. Third patameter (arr ) is the character array that will contain the substring. It will contain the characters starting from stringStart to stringEnd-1. arrStart is the index inside arr at which substring will be copied. The arr array should be large enough to store the substring.
getChars() method has an alternative which is toCharArray() and it gives us the array of chars. Also we have operation substring which takes the first index and last index.
Don't miss out!