Next:
About the Author
Contents
A CONCISE MANUAL ON
JAVA PROGRAMMING
Kamakshaiah Musunuru
About the Author
Contents
Preface
About Java
History
Principles
Versions
Editions
Execution system
Java JVM and bytecode
Performance
Non-JVM
Automatic memory management
Syntax
Hello world example
Example with methods
Special Classes
Applet
Overview
Servlet
Example
JavaServer Pages
Swing application
Examples
JavaFX application
JavaFX platform components
Example code
Class libraries
Data types & Structures
Using Scripts in CMD
How Java "Hello, World!" Program Works?
Using Eclipse
Java Keywords and Identifiers
Access Modifiers
Default
Private
Protected
Static vs. Non-static routines
Accessing members and methods
Calling process
Binding process
Overriding
Java Keywords
Java Keywords List
Java identifiers
Rules for Naming an Identifier
Java Variables
Rules for Naming Variables in Java
Java Primitive Data Types
8 Primitive Data Types
boolean
byte
short
int
long
double
float
char
String
Java literals
Integer Literals
Floating-point Literals
Character and String Literals
Operators
Assignment Operator
Assignment Operator
Arithmetic Operators
Example
Unary Operators
Unary Operator
Increment and Decrement Operator
Example
Equality and Relational Operators
Example
instanceof
Operator
Java
instanceof
Example
Java Arrays
Initializing Arrays in Java?
Accessing Elements of an Array in Java
Looping Through Array Elements
Multidimensional Arrays
initialize a 2d array in Java
Copying Arrays Using Assignment Operator
Using Looping Construct to Copy Arrays
Copying Arrays Using arraycopy() method
Copying Arrays Using copyOfRange() method
Copying 2d Arrays Using Loop
Copying 2d Arrays using arraycopy()
Java Lists
Java Collections Framework
Java Collection Interface
ArrayList Class of Collections
Methods of Collection
Classes that Implement List
How to use List?
Methods of List
Implementing the ArrayList Class
Implementing the LinkedList Class
Java List vs. Set
Using index number
Add elements of an array list to another array list
Initialize an ArrayList Using asList()
Access ArrayList Elements
Using
get()
Method
Using
iterator()
Method
Change ArrayList Elements
Remove ArrayList Elements
Using
remove()
Method
Using
removeAll()
method
Using
clear()
Method
Loop Through an ArrayList
Using for loop
Using the forEach loop
Get ArrayList Length
Sort Elements of an ArrayList
Java ArrayList To Array
Java Array to ArrayList
Java ArrayList to String
Vectors
Java
Vector
vs.
ArrayList
Creating a Vector
Methods of Vector
Other Vector Methods
Java Stacks
Creating a Stack
Stack Methods
push()
Method
pop()
Method
peek()
Method
search()
Method
empty()
Method
Java Queue
Working with Queue Data Structure
Methods of Queue
Implementation
Implementing the LinkedList Class
Deque Interface
Implementation of Deque in ArrayDeque Class
Java Map
Methods of Map
Implementing
HashMap
Class
Implementing TreeMap Class
Methods of HashMap
Insert Elements to HashMap
Access HashMap Elements
Remove Elements
Replace Elements
Recompute Values
Using
merge()
Method
Iterate Through a HashMap
Java Set
Methods of Set
Implementation of the Set Interface
Implementing HashSet Class
Implementing TreeSet Class
Java
enums
Methods of enum Class
Why Java enums?
Java
enum
Constructor
Java
enum
Strings
Java I/O Streams
Java InputStream Class
Methods of InputStream
Java
OutputStream
Class
Methods of
OutputStream
Java Reader/Writer
Methods of Reader
Java Writer Class
Methods of Writer
Control Flow and Decision Making
Java
if, if...else
Statement
Java
if...else (if-then-else)
Statement
Nested
if..else
Statement
Java Ternary Operator
When to use ternary operator?
switch
statement
Java
for
Loop
infinite for Loop
Java
for-each
Loop
for
loop
Using for-each
loop
Disadvantages of Using for-each Loop
Java
while
loop
How
while
loop works?
Java do...while Loop
Infinite while Loop
Java
break
Statement
Labeled break Statement
Java
continue
Statement
Labeled continue Statement
Object-Oriented Programming
Programming Paradigms
Object-Oriented Programming
Features
Objects and classes
Class-based vs prototype-based
Dynamic dispatch/message passing
Encapsulation
Composition, inheritance, and delegation
Polymorphism
Open recursion
OOP in dynamic languages
Classes & Objects in Java
Class
Object
Declaring Objects
Initializing an object
Ways to create object of a class
Creating multiple objects by one type only
Anonymous objects
Inner Classes (Nested)
Advantage of Java inner classes
Types of Nested classes
Methods in Java
Method Declaration
Types of Method
Predefined Method
User-defined Method
How to Call or Invoke a User-defined Method?
Static Method
Instance Method
Abstract Method
Constructors in Java
Default Constructor
Parameterized Constructor
Constructor Overloading
static
,
this
,
Super
&
final
keywords
static
Java static variable
Java static method
Java static block
this
keyword in Java
To refer current class instance variable
To invoke current class method
To invoke current class constructor
To pass as an argument in the method
To pass as argument in the constructor call
To return current class instance
Super
Keyword in Java
super
is used to refer immediate parent class instance variable.
super
can be used to invoke parent class method
super
is used to invoke parent class constructor
final
keyword
Java final variable
Java final method
Java final class
Blank or uninitialized final variable
static blank final variable
final parameter
Modules
Packages
Subpackage in java
Example of Subpackage
Encapsulation
Abstraction
Abstract class in Java
Abstract Method in Java
Real scenario
Abstract class having constructor, data member and methods
Interface
Java Interface Example
Java Interface Real time example
Multiple inheritance in Java by interface
Interface inheritance
Default Method in Interface
Static Method in Interface
Nested Interface in Java
Inheritance
Types of inheritance in java
Single Inheritance Example
Multilevel Inheritance Example
Hierarchical Inheritance Example
Polymorphism
Runtime Polymorphism in Java
Example of Java Runtime Polymorphism
Java Runtime Polymorphism Example: Bank
Method Overriding & Overloading
Overriding
Example of method overriding
Overloading
Method Overloading: changing no. of arguments
Method Overloading: changing data type of arguments
Method Overloading: changing data type of arguments
Exception Handling
Errors Vs. Exceptions
Exceptions
Default Exception Handling
Types
Built-in exceptions
Arithmetic exception
NullPointer
Exception
StringIndexOutOfBound
Exception
FileNotFound
Exception
NumberFormat
Exception
ArrayIndexOutOfBounds
Exception
User-Defined Exceptions
Try-catch
Control flow for Exception Handling
Exception occurs in try block and handled in catch block
Control flow in try-catch-finally clause
Multithreading
Multitasking
Process-based Multitasking (Multiprocessing)
Thread-based Multitasking (Multithreading)
What is Thread in java
Life cycle of a Thread (Thread States)
How to create thread
Thread class
Java Thread Example by extending Thread class
Thread Scheduler in Java
Sleep method in java
The
join()
method
getName(),setName(String)
and
getId()
method:
The
currentThread()
method
Naming Thread
Current Thread
Priority of a Thread (Thread Priority)
Daemon Thread in Java
Java Thread Pool
ThreadGroup in Java
Java Shutdown Hook
Performing single task by multiple threads
Performing multiple tasks by multiple threads (multitasking in multithreading)
Annonymous class that implements Runnable interface
Java Garbage Collection
How can an object be unreferenced?
finalize() method
gc() method
Java Runtime class
Java Runtime exec() method
How to shutdown system in Java
Java Runtime freeMemory() and totalMemory() method
About this document ...