You are on page 1of 12

Rebooot Mind

Table of Contents
Core Java
1. Introduction to OOPS & Java Programming
2. Language
3. Variables
4. Control Structures
5. Data Types
6. Classes and Objects
7. Abstract, Static and Final
8. Inheritance
9. Packages
10.
Interfaces
11.
Exception Handling
12.
IO Package
13.
String Handling
14.
Threading and Multithreading
15.
Serialization
16.
Collection Framework
17.
Lang Package
18.
Files and Streams
19.
Networking Package
20.
Applets and AWT
21.
Event Handlers and Listeners
22.
JFC
23.
Swings
24.
Security
Advanced Java
J2EE Module I
1. Introduction to J2EE Architecture
2. J2EE Components and Technologies
3. JDBC
a. Types of Drivers
b. JDBC Classes and Interfaces
c. Statements
d. Prepared Statements
e. Callable Statements
f. Scrollable Result Sets
g. Batch Updations
h. Save Points
i. Row Sets
4. Servlets
a. Life Cycle
b. Introduction to HTTP

c.
d.
e.
f.
g.
h.
i.
j.
k.
l.
5. JSP
a.
b.
c.
d.
e.
f.
g.
h.
i.
j.
k.
l.
m.

HTML Basics
Servlet Classpath
Http Servlet Request
Http Servlet Response
Request Dispatcher
Managing Cookies
Session Handling
Filters
Listeners
Web.xml Deployment
MVC Architecture
Life Cycle
Tags
Directive Tags
Declaration Tags
Expression Tags
Scriplets
Comments
Implicit Objects
Standard Action Tags
Error Pages
Custom Tags
Types of Custom Tags

J2EE Module II
1. STRUTS
a. Struts Architecture
b. MVC And Model 2
c. More XML, Less Java!
d. Action Mappings
e. Command Pattern for web applications
f. ActionServlet
g. Action and Action Mapping
h. Struts Configuration
i. Selecting a forward
j. Global Forwards
k. Declarative Exception Handling
l. Global Exception Handlers
m. Forms
i. Working with HTML Forms
ii. Action Forms a/k/a Form beans
iii. Relationship to Input
iv. Relationship to actions
v. Relationship to the model
vi. Relationship to the Output
vii. DynaActionForm and Map-Backed Forms
viii. Validation
ix. Struts Tag Libraries

n.

o.

p.
q.

r.

x. Building View Components


Struts Tag Libraries
i. Attributes and Struts Expressions
ii. Building Forms
iii. <html:form>
iv. <html:text>et. Al
v. Forms and Form beans
vi. Scope and duration of Form Data
vii. Error Messages
viii. Logic Tags
The JSP Standard Tag Library
i. JSTL Overview
ii. JSP Expression Language
iii. Core Tags
iv. Formatting Tags
Internationalization and Localization
Input Validation
i. Validation in Web Applications
ii. Validation in Struts
iii. The Struts Validator Plug-In
iv. Validating ActionForm Subtypes
v. Configuring Validation
vi. Standard Validators
vii. Rules
viii. The ActionMessages Class
ix. Mapping-Based Validation
x. Modules
Tiles
i. Consistent look and feel
ii. Reusable Layouts and content
iii. The Tiles Framework
iv. Instantiating Layouts

2. XML
a.
b.
c.
d.

Elements/Entities of XML
DTD
XML Syntax and parsing
Elements, tags and attributes

3. JAAS
a.
b.
c.
d.
e.
f.
g.

XML
Role of XML
Role and function of a DTD
XML schema structure
JAXP: the Java XML API
XML Parsers for Java
Role of SAX and DOM

J2EE Module III


1. DESIGN PATTERNS

a. Session Faade
b. Message Faade
c. Service Locator
d. Value Object
e. Value Object Factory
f. Single term pattern
2. Introduction to web servers (JBoss/Weblogic/websphere)
3. HIBERNATE
a. Installation and setup
b. Introduction to mapping
c. Writing a mapping document
d. Generating some class
e. Cooking up a schema
f. Connecting hibernate to MySQL
g. Harnessing Hibernate
i. Creating persistent Objects
ii. Finding Persistent Objects
iii. Better ways to build queries
h. Collections and Associations
i. Mapping collections
ii. Persisting collections
iii. Retrieving collections
iv. Using bidirectional associations
v. Working with simple collections
i. Criteria Queries
i. Using simple criteria
ii. Compounding criteria
iii. Applying criteria to associations
iv. Querying by example
j. A Look at HQL
i. Writing HQL queries
ii. Selecting properties and pieces
iii. Sorting
iv. Working with aggregate values
v. Writing native SQL queries.
4. SPRING
a. Introduction to Spring
b. The Spring application context
c. XML Configuration
d. Working with existing singletons and factories
e. Working with multiple configuration files
f. Understanding the bean lie cycle
i. XML Namespaces initialization, use and destruction phases
ii. Working with spring interceptors
iii. Externalizing constant values into properties files
iv. Bean scopes
g. Simplifying application configuration
i. Bean definition inheritance
ii. Inner beans and util namespaces
iii. Dependency injection of collections
iv. Spring Expression Language(SpEL)

h. Annotation based Dependency injection


i. Autowriting and component scanning
ii. Stereotype annotations
iii. Java-based configuration mixing configuration styles
iv. When to use XML, annotations, and java configuration
i. Aspect Oriented Programming
i. what problems does AOP solve?
ii. Difference between Spring AOP and AspectJ
iii. Defining pointcut expressions
iv. How to use the types of advice: around, before and after
j. Data Access and JDBC with Spring
i. How spring integrates with existing data access technologies
ii. DataAccessException hierarchy jdbc namespace
iii. Simplifying jdbc access using the spring jdbctemplate
k. Spring in a web application
i. configuring Spring in a web application
ii. introduction to Spring MVC
iii. defining Spring MVC Controllers using annotations
5. AJAX
a.
b.
c.
d.
e.
f.

Introduction
Request, browsers
XML HTTP Request
Server Script, Advanced
Database
XML File

CORE JAVA
Introduction to OOPS & Java Programming
Problems with Procedural programming
o Data does not have the owner.
This means the data can be accessed by anybody in the program and if any
problem arises because of any function, it will be difficult to identify who is the
culprit. This causes the failure in data integrity
o Functions are the building blocks and the flow of execution will be continuous in
nature which cause achieving some functionality difficult.
o Examples of procedural languages are like COBOL, FORTRAN, BASIC, PASCAL, C, C++
etc.
o The main problem with this programming languages along with the data integrity is
with the uninitialized variables where these variables will take garbage values without
any warning.
o One more major problem with this is resource de-allocation. When this resource deallocation is not handled properly, it leads to memory leaks which in-turn brings down
the application abruptly.
o These languages will not support the concept of abstraction
Objects and Classes
o Object Concept
An object is nothing but encapsulation of data
An object will have the following characteristics
An unique identity
o This is nothing but a unique reference of the object to identify
State

This indicates the characteristic or property. Represented by


variables. These variables can be different types which can be
discussed later.
Behavior
o This indicates the action manipulations. These are represented by
methods.
An Object is an instance of a class
o Class Concept
Class is an Abstract Data Type. Using the class, a new data type can be defined
and for this data type, the data representation as well as the behavior of that
value will be defined.
A class is considered to be a collection of objects or values and corresponding
methods.
A class encapsulates the data representation and makes data access possible at
a higher level of abstraction.
For example, a vehicle with specific characteristics and behavior is an
example of a class and its corresponding object
A class can be defined as the combination of state and behavior. Here, state is
represented by the variables of the class and the behavior is represented by the
methods of the class. Based on this definition, it is very easy to differentiate the
characteristics of an object which can be caught at the time of compilation itself.
Abstraction
o As per grady Booch, the definition of Abstraction is as follows
Abstraction focuses on the essential characteristics of some object, relative to
the perspective of the user.
o Understanding the definition, abstraction means hiding the complexity from the user.
For example, we might have an application which is performing some complex
operations. But when it comes in the view of the user, he is supposed to know what
functionality he can get from the application but not to know how that complexity is
maintained inside the application. For this purpose, the complexity of the application
can be hidden in one of the methods inside the application and then a simple user
interface will be published to the end user so that he can use that interface to access
the functionality and no need to know how it is achieved. This is nothing but hiding the
complexity of the application from the user and providing the simple interface. This is
abstraction.
Encapsulation and Information Hiding
o In order to maintain the data integrity, it must be guarded well. This can be achieved
through encapsulation. Encapsulation is nothing but information hiding. This means,
we will not allow everybody to manipulate the data and those rights will be provided
only for few. The following are the rules for encapsulation.
All Data must be hidden and this can be achieved by defining the variables as
private.
Read access of the data should be provided using read functions
Write access of the data should be provided using the write functions
For every piece of data 4 types of operations can be provided as stated below
Read and write allowed
o

Class

Read only
Write only
No access

structure defined in terms of this abstraction and encapsulation is as follows


State+behavior
State = variables
Variables = private variables + public variables
Behavior = methods
Methods = private functions + public functions
Private functions can be accessed by public functions in the same class
All the public functions and variables defined inside a class forms the public
interface that was published to the outside world to use. This is nothing but the
public API that we call in general terms.
o Data can be accessed only through the use of methods.
o Class can be defined as the description of common properties of a set of objects
and this is a concept which is part of a program
o Object can be defined as the representation of the properties of a single instance
and this is a phenomenon which is part of the data and a program execution.
o Instantiation is nothing but creating an object of a class. And this is the place
where the memory allocation of the object will be done and the initialization of
the object will take place and this will be done inside the constructors.
o Objects can be created in two ways ie static instantiation and dynamic
instantiation. When the objects are created during the declaration time then it is
static in nature and when they are created during the method calls that is inside
the methods then it is dynamic in nature.
o Objects interact to each other by sending messages to each other and this
communication happens through the calls to methods.
o A phenomenon is the one which has physical existence in real world and so an
object is a phenomenon.
o A concept is a generalization which is derived from a set of phenomenons and
based on the common properties of these phenomenon.
Mental Exercises
o Classification and Exemplification
Classification is a description of which phenomenon that belongs to a concept
Exemplification is a phenomenon that covers the concept.
o Aggregation and Decomposition (has-a relationship)
Make new objects by using existing objects
Decomposition is deriving objects from existing objects
o Generalization and Specialization (is-a or is-like-a relationship)
Generalization creates a concept with broader scope
Specialization creates a concept with a narrower scope.
These two are used for reusing the interface.
Inheritance
o This is used to get the interface from the more general class.
o This allows the code reuse
o

This is used to extend the functionality of class


Helps user to extend a functionality even though he dont have access to the source of
his main required class.
Polymorphism and Dynamic Binding
o This is used to represent one object in many different forms. This means the same
object can be used with different meanings in different situations.
Java an example of Object-Oriented Programming
o Program example
Java program will be compiled by the compiler first where the java file will be
compiled and class file is created. This class file will have the java bytecode
which can run on any platform. But in other languages the programs will be
compiled directly to the native OS.
Explain about the simple hello world program and explain the constructs of the
program.
o History of java
1990 OAK (interactive television, big failure)
1994 Java (for the internet)
Main feature: write once, run anywhere
Designed for
A fresh start
Pure OOP
Improvements over C++
Internet programming

o Five rules for Pure Object Oriented programming


Everything is an object
A program is a set of objects talking to each other by invoking each others
methods
Each object will have its own memory
Every object has a type
All objects of a specific type can receive the same messages.
o Java breaks some of these rules in the name of efficiency.
o
o

Language
Java language is used to develop applications for a wide range of environments from
consumer devices to heterogeneous enterprise systems. In this section we will look into the
environment that is required to develop a java application and we look into the java
components and the java platform.
The general tip for the java developers is to look at the offline java API docs which is also
called as java docs.
Like any programming language, java language also has its own syntax, grammar rules and
programming paradigms. This language is completely developed based on the oops concepts.
Java language is a derivative of C and so the syntax rules used in java are very similar to C,
for example the code blocks are modularized into methods and are delimited by curly braces.

Structurally java language starts with packages. These packages are the name space
mechanism being used in java. Within packages are the java classes and within java classes
are the methods, variables and constants and so on. As we proceed further we will discuss
about all these components.
COMPILER
Generally when you write a java program, first you write the source code in .java files and
then compile those java files. The compiler checks your source code against the syntax rules
which are defined as per the specifications defined and then create the bytecodes and write
the byte codes in the form of the class files. Bytecodes are standard instructions that are
targeted to run on a java virtual machine. This JVM is designed specifically for each different
platform. This is the mechanism which is used to run a java application on many different
platforms and this is the mechanism which gives the java the capability to write once and run
anywhere. This means, we can run a java application in any OS. By adding this level of
abstraction, java differs from other programming languages where programs write the
instructions targeted towards the particular CPU on which the application is running.
JVM
Once the application is compiled and the bytecode representation of the code is created in
the form of class files, the JVM then reads that bytecode and interprets and then executes
those instructions on the native hardware platform for which that particular JVM was written.
Here the main thing to understand is that JVM interprets the bytecode just as how the
underlying OS interprets the assembly language instructions.
GARBAGE COLLECTOR
The memory management in java is taken care by the mechanism called garbage collector.
When the application creates a new object, jvm automatically allocates the memory for that
object from the heap which is a pool of memory set aside for the program to use. The java
garbage collector will be always running on the background tracking what and all are the
objects are not being used in the application and once that identification is done, they will be
removed from the memory thereby freeing the memory automatically. This approach is called
implicit memory management because we dont want to write any code to handle the
memory specifically. This is one of the most important feature for java performance.
THE JAVA DEVELOPMENT KIT
In order to develop the java applications and wants them to be compiled, we need the JDK.
You can download this JDK for free of cost from the sun site. This jdk comes along with the
compilers and other tools required in the application development process. In JDK you will
get all the pack of pre built classes and utilities required to develop a java application.
THE JAVA RUNTIME ENVIRONMENT

The java runtime environment also known as java runtime includes the JVM, code libraries,
and components that are required for running a java application. This will be available for
different OS platforms.

SOME GENERAL TERMS


PLATFORM INDEPENDENCE
Platform independence is a programs capability of moving easily from one computer system
to other. This means, at the source level, java primitive data types have the same size
across the platforms. Because of this it can be easy to move the code from one system to
other system easily. Another aspect which helps to achieve the same is that java binary files
will be in the form of bytecodes and this bytecode can work on any platform with ease.
Bytecodes are a set of instructions that looks a lot like some machine codes, but that is not
specific to any one processor.
The java development environment has two parts: a java compiler and a java interpreter. The
java compiler reads your source code and instead of generating machine code it generates
the bytecode. To run a java program you run a program called bytecode interpreter which in
turn executes java program.
Language basics
Java allows you to create the first class objects but everything in java is not a object. The
java language is a combination of objects and primitive data types. Second, java allows you
to write the objects that expose its inner working to other objects who uses it. Java is all
about the objects and so here we will discuss about the ways how java handle them. For this,
we need the help of reserved words and we will understand the structure of an object.

RESERVED WORDS:
The following are the reserved used being used in java,
Abstract, assert, Boolean, break, byte, case, catch, char, class, const, continue, default, do,
double, else, enum, extends,final, finally, float, for, goto,if, implements, import, instanceof,
int, interface, long, native, new, package, private, protected, public, return, short, static,
strictfp, super, switch, synchronized, this, throw, throws, transient, try, void, volatile, while.

Also note that true, false and null are technically not reserved words. Although they are
literals they are included in this list because we cant use them as names of java constructs.

Now we will start programming with java. For the purpose, we will write a simple java
program.

Class HelloWorld {
public static void main(String args[]) {
System.out.println(Hello World);
}
}

You might also like