08448380779 Call Girls In Friends Colony Women Seeking Men
Basics-Of-Java
1. INDEX
• Programming methodologies
• Language Development
• Why Programming Language & Evolution of Languages.
• History Of Java
• Why Only Java ?
• What is Java ?
• Where Java is Used in the industry ?
• Flavors of Java
• Features Of Java
• Architecture Of JVM
• A Basic Java program & its internal details
2. PROGRAMMING METHODOLOGIES
Deals with two elements:
1. Data – memory
2. Functions - code
Programming
Standards
Unstructured
Programming
Procedural
Methodology
Structured
Programming
Object Oriented
Programming
Two Techniques
4 Features
Inheritance
Polymorphism
Abstraction
Encapsulation
Object Based P/L
Any one feature of OOPs
but not all. Eg: VB
3. LANGUAGE DEVELOPMENT – BUILDING BLOCKS
For Natural Languages
Noun
Words
Sentences
Paragraphs
etc
Literals
Pronoun
For Programming Languages
Lexical Tokens
Statements
Program
Strings
Keywords Identifiers Operators
Grammar
Syntax - rules
Logic
To Solve Problem
(48)
Unary Binary Ternary
4. DATATYPES & ASSOCIATED KEYWORDS
void
Lexical Tokens
Boolean
Character Integer Floating Point
float
4B
Double
8B
Long double
10B
Char
2B
deprecated
Byte
1B
short
2B
int
4B
long
8B
boolean
True
false
6 14
Decimal points
5. Electronic
Devices
Microprocessors
Before
Computer
Technology
introduction
Machine & Assembly
Languages
Drawbacks
Code Complexity
Difficult to understand
Procedure Oriented
Methodology
Drawbacks
Complexity cant be handled
No Security For Data
Any part of memory can be
accessed
First Computer
Languages
High Level
Languages
Ex: C, Fortran,
Pascal, Cobol
Object Oriented Methodology
EVOLUTION OF LANGUAGES & BIRTH OF OOPS
Languages
Ex: C++, Java,
C#, ABAP
A P/L is used to develop Applications to simplify user tasks.
The Central Theme of any P/L is to Store, manipulate and retrieve data.
6. HISTORY OF JAVA
Bill Joy – Wrote “Further”
Patrick Naughton – Green Project
James Gosling – OAK (Frustration on C++)
Sun Announced Java in a Major Conference 1995
1970 - 1990
1983
1991
Time Line Releases Classes Packages
1996 Java 1.0 (JDK 1.0) 212 8
1998 Java 1.2 1548 64
2004 Java 1.4 (SDK 1.4)
2006 Java 1.5 3562 166
2008 Java 1.6
Major Releases:
7. WHAT IS JAVA
JAVA
Programming
Language
Platform
Technology
JVM API Class
Files
Design
Runs
Java is a multi dimensional software entity and defined as below.
Programming Lang --- It is a Third Generation P/L like C, C++, Fortran, C#, VC++
etc. It is capable to work with internet inside electronics and supports database.
Technology ---- Java is a Technology pertaining to Database, Electronics and
Enterprises.
Platform ---- It is a S/W or H/W environment in which a program gets executed.
Java acts as a platform between Operating System & Application Software.
8. FEATURES OF JAVA
Simple
Object Oriented
Network Supported
Secured
Portable
Robust
Platform Independent /
Architecture Neutral
Dynamic
High Performance
Multi – Threaded
Interpreted
Simple – It is designed to write bug free code easily. Generally, bugs related to memory
allocation and garbage collection are reduced than in C and C++.
Object Oriented – Data is represented in terms of Objects( gives security to data). Objects
have state(data) and behavior(methods). Implements all OOP’s features.
Secured – Secure execution of code. OS too doesn’t understands the byte code. JVM only
executes it. Malicious code over network can be executed securely.
Robust – JVM is developed free of bugs. Handling of exceptions to prevent crashing of
system and prohibiting the introduction of viruses by checking the byte code.
9. High Performance – Java Byte codes can be complied on the fly using JIT compiler. Faster Execution on
Programs. Memory never runs out.
Multi – Threaded – A single program can have different processes executing independently and
continuously. It makes java robust as processes doesn’t gets extra CPU cycles and malicious code
execution is prevented.
Dynamic(ly linked) – No Explicit linking in java. When other classes are referenced, compiler searches
them in local system and they are linked.
Portable – Source code written on one machine can work on multiple machines having different
Operating Systems and configurations.
Platform Independent - An executable code generated on one machine can work on multiple
machines having different Operating system and related JVM of that OS.
Byte Code
Executable code
(Given to JVM)
JVM
(passes to OS)
UNIX OS
Hardware
C/C++ Executable
code (given to OS)
UNIX OS
(OS executes over
H/W)
Hardware
JVM
Windows OS
Hardware
Windows
Operating
System
Hardware
Fails
cant
give to
H/w
10. ARCHITECTURE OF JVM – JAVA VIRTUAL MACHINE
Method
Area
Stack
Area
Heap
Area
PC
Registers
Native
Method
Stack
Native
Method
API
Class Loader
Sub System
Execution
Engine
• JVM is a Specification , Implementation & Runtime Instance for a java program to run.
• It is a specification given by Sun Micro Systems and implemented by various Vendors
and can come into existence only when Java application is executed.
11. Class Loader Sub System – bytecode is loaded through class loader. It uses classpath.
Method Area – It stores all the compiled instructions
Stack Area – It contains the memory space for respective methods and their local
variables. Every method call will be stored in Stack.
Heap Area – Objects are stored.
PC Registers – Program Counter – It contains the information about the next executable
instruction
Native Method Stack & Native Method API – Working with C/ C++ methods in java. We
use the native API.
Execution Engine - It loads, links and initializes memory spaces with values. Creates
objects through memory spaces.
12. OOPS AND ITS FEATURES
OOP’s is not a programming language. It is just a concept which has 4 features.
1. ENCAPSULATION – Binding of Data and Functions(methods) into one single unit.
2. ABSTRACTION – Providing various levels of hiding over Encapsulated data and
functions. This is used to provide security to our application.
3. POLYMORPHISM – Multiple behaviors of data and functions.
4. INHERITANCE – It is the ability to re – use the data and functions of one
encapsulation for another encapsulation.
A Programming language which supports all the four features is known as “ Object
Oriented Programming Language”.
Ex: C++, Java, C# etc.
If Any language supports at least one but not all four is known as “ Object Based
P/L”.
Ex: VB.
13. DEVELOPMENT OF JAVA PROGRAMS
Develop Source Code
Execute using
“java” command
Compile it using
“javac” command
Save with .java extension
JAVA
API
Using
Using An Editor
Notepad/ Editplus
Install the Latest JDK
Set Environment Variables
Permanently
CLASSPATH – Class Files &
Bytecode location
PATH – OS uses to
get java resources
JVM runs this not OS.
JVM uses OS for I/O.
OS uses Hardware.
.class is generated which
contains Bytecode
Compiler
Interpreter
14. EDITIONS / FLAVORS OF JAVA
JAVA
JAVA ME
JAVA SE
JAVA EE
Standard Edition
Micro Edition
Enterprise Edition
Stand Alone /
Desktop Based
Applications
Large Scale
Enterprise
Applications, Web
Servers
Consumer Device
applications for
mobiles, PDA, pagers
etc.