SlideShare a Scribd company logo
Module 01 – Introduction to Java
Danairat T.
Line ID: Danairat
FB: Danairat Thanabodithammachari
+668-1559-1446
Fundamental Java Programming
The Course Outline
Module 01 – Introduction to Java
Module 02 – Basic Java Programming
Module 03 – Control Flow and Exception Handling
Module 04 – Object Oriented in Java
Module 05 – Java Package and Access Control
Module 06 – Java File IO
Module 07 – Java Networking
Module 08 – Java Threading
Module 01 – Introduction to Java
• Introduction
• Java History
• Java Principles
• Java Platform
• HotSpot JVM
• Writing a First Java Program
• Coding Convention
Specific
Application
Development
Knowledge
Application Development
Knowledge
Foundation
Programming
Knowledge
Fundamental
Java
Programming
(Control Flow, OO,
Java Network)
Java EE and Dev.
Frameworks
(Containers, Spring,
Hibernate, ADF, etc.)
SOA, ESB, CEP,
BPEL, BPM, ECM
Portal, RIA, SSO,
IdM
Development
Lifecycle
- Project Mgmt.
- Release Mgmt.
- Req. Mgmt. (Roles, Event)
- Design. Build
- Fn & Non-Fn Test
- Migrate, Deploy, Monitor
- Support
Java Developer Trainings
Java History
Originally, Java developed by James Gosling at Sun
Microsystems (which is now a subsidiary of Oracle
Corporation) and released in 1995 as a core component of
Sun Microsystems' Java platform.
The language derives much of its syntax from C and C++
but has a simpler object model and fewer low-level
facilities.
Java applications are compiled to bytecode (class file)
that can run on any Java Virtual Machine (JVM) regardless
of computer architecture.
Java History
JDK 1.0 (1995) — First Java Released.
JDK 1.1 (February 19, 1997) — Major additions included an extensive retooling
of the AWT event model, inner classes added to the language, JavaBeans and
JDBC.
J2SE 1.2 (December 8, 1998) — Codename Playground. This replaced JDK to
distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition)
and J2ME (Java 2 Platform, Micro Edition). Major additions included reflection,
a Collections framework, Java IDL (an IDL implementation for CORBA
interoperability), and the integration of the Swing graphical API into the core
classes.
J2SE 1.3 (May 8, 2000) — Codename Kestrel. Notable changes included the
bundling of the HotSpot JVM (the HotSpot JVM was first released in April,
1999 for the J2SE 1.2 JVM), JavaSound, Java Naming and Directory Interface
(JNDI) and Java Platform Debugger Architecture (JPDA).
Java History
J2SE 1.4 (February 6, 2002) — Codename Merlin. This was
the first release of the Java platform developed under the
Java Community Process as JSR 59. Major changes included
regular expressions modeled after Perl, exception chaining,
an integrated XML parser and XSLT processor (JAXP), and
Java Web Start.
J2SE 5.0 (September 30, 2004) — Codename Tiger. Originally
numbered 1.5, which is still used as the internal version
number. Developed under JSR 176, Tiger added a number of
significant new language features including the for-each
loop, generics, autoboxing and var-args.
Java History
Java SE 6 (December 11, 2006) — Codename Mustang — The current version is
bundled with a database manager, facilitates the use of scripting languages
(currently JavaScript using Mozilla's Rhino engine). As of this version, Sun replaced
the name "J2SE" with Java SE and dropped the ".0" from the version number. Other
major changes include support for pluggable annotations (JSR 269), lots of GUI
improvements, including native UI enhancements to support the look and feel of
Windows Vista, and improvements to the Java Platform Debugger Architecture
(JPDA) & JVM Tool Interface for better monitoring and troubleshooting
Java SE 7 — Codename Dolphin. The Dolphin Project started in August 2006, with
release estimated in 2011. New builds including enhancements and bug fixes are
released approximately weekly.
In addition to the language changes, much more dramatic changes have been made
to the Java class library over the years, which has grown from a few hundred
classes in JDK 1.0 to over three thousand in J2SE 5.0. Many of the original JDK 1.0
classes and methods have been deprecated.
Java Principles
There were five primary goals in the creation of the Java
language:
1. It should be "simple, object oriented and familiar".
2. It should be "robust and secure".
3. It should be "architecture-neutral and portable".
4. It should execute with "high performance".
5. It should be "interpreted, threaded, and dynamic".
Java Platform
Java SE (Standard Edition): For general-purpose use on
desktop PCs, servers and similar devices.
Java EE (Enterprise Edition): Java SE plus various APIs useful
for multi-tier client–server enterprise applications.
Java ME (Micro Edition): Specifies several different sets of
libraries (known as profiles) for devices that are sufficiently
limited that supplying the full set of Java libraries would take
up unacceptably large amounts of storage. it is not used on any of today's
newest mobile platforms (e.g. iPhone, Android, Windows Phone 7, MeeGo, BlackBerry's new QNX).
Java Card: A technology that allows small Java-based
applications (applets) to be run securely on smart cards and
similar small-memory-footprint devices.
Java FX
A software platform for creating and delivering rich Internet
applications that can run across a wide variety of connected
devices to build applications for desktop, browser and mobile
phones. TV set-top boxes, gaming consoles, Blu-ray players and
other platforms are planned.
To build JavaFX apps developers use a statically typed, declarative
language called JavaFX Script; Java code can be integrated into
JavaFX programs.
JavaFX is compiled to Java bytecode, so JavaFX applications run
on any desktop and browser that runs the Java Runtime
Environment (JRE) and on top of mobile phones running Java ME.
JavaFX may compete on the desktop with Adobe AIR, Apache Pivot, OpenLaszlo and Microsoft Silverlight.
HotSpot JVM
providing Java runtime facilities, such as thread and
object synchronization, on a variety of operating
systems and architectures. It includes dynamic
compilers that adaptively compile Java bytecodes
into optimized machine instructions and efficiently
manages the Java heap using garbage collectors,
HotSpot JVM Options
Option and Default Value Description
-XX:-AllowUserSignalHandlers Do not complain if the application installs signal handlers. (Relevant to Solaris and
Linux only.)
-XX:AltStackSize=16384 Alternate signal stack size (in Kbytes). (Relevant to Solaris only, removed from
5.0.)
-XX:-DisableExplicitGC Disable calls to System.gc(), JVM still performs garbage collection when
necessary.
-XX:+FailOverToOldVerifier Fail over to old verifier when the new type checker fails. (Introduced in 6.)
-XX:+HandlePromotionFailure The youngest generation collection does not require a guarantee of full promotion
of all live objects. (Introduced in 1.4.2 update 11) [5.0 and earlier: false.]
-XX:+MaxFDLimit Bump the number of file descriptors to max. (Relevant to Solaris only.)
-XX:PreBlockSpin=10 Spin count variable for use with -XX:+UseSpinning. Controls the maximum spin
iterations allowed before entering operating system thread synchronization code.
(Introduced in 1.4.2.)
-XX:-RelaxAccessControlCheck Relax the access control checks in the verifier. (Introduced in 6.)
-XX:+ScavengeBeforeFullGC Do young generation GC prior to a full GC. (Introduced in 1.4.1.)
-XX:+UseAltSigs Use alternate signals instead of SIGUSR1 and SIGUSR2 for VM internal signals.
(Introduced in 1.3.1 update 9, 1.4.1. Relevant to Solaris only.)
-XX:+UseBoundThreads Bind user level threads to kernel threads. (Relevant to Solaris only.)
-XX:-UseConcMarkSweepGC Use concurrent mark-sweep collection for the old generation. (Introduced in 1.4.1)
-XX:+UseGCOverheadLimit Use a policy that limits the proportion of the VM's time that is spent in GC before
an OutOfMemory error is thrown. (Introduced in 6.)
-XX:+UseLWPSynchronization Use LWP-based instead of thread based synchronization. (Introduced in 1.4.0.
Relevant to Solaris only.)
-XX:-UseParallelGC Use parallel garbage collection for scavenges. (Introduced in 1.4.1)
-XX:-UseParallelOldGC Use parallel garbage collection for the full collections. Enabling this option
automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.)
-XX:-UseSerialGC Use serial garbage collection. (Introduced in 5.0.)
-XX:-UseSpinning Enable naive spinning on Java monitor before entering operating system thread
synchronizaton code. (Relevant to 1.4.2 and 5.0 only.) [1.4.2, multi-processor
Windows platforms: true]
-XX:+UseTLAB Use thread-local object allocation (Introduced in 1.4.0, known as UseTLE prior to
that.) [1.4.2 and earlier, x86 or with -client: false]
-XX:+UseSplitVerifier Use the new type checker with StackMapTable attributes. (Introduced in 5.0.)[5.0:
false]
-XX:+UseThreadPriorities Use native thread priorities.
-XX:+UseVMInterruptibleIO Thread interrupt before or with EINTR for I/O operations results in OS_INTRPT.
(Introduced in 6. Relevant to Solaris only.)
Behavioral Options
Option and Default Value Description
-XX:+AggressiveOpts Turn on point performance compiler optimizations that are expected to be default in
upcoming releases. (Introduced in 5.0 update 6.)
-XX:CompileThreshold=10000 Number of method invocations/branches before compiling [-client: 1,500]
-XX:LargePageSizeInBytes=4m Sets the large page size used for the Java heap. (Introduced in 1.4.0 update 1.) [amd64:
2m.]
-XX:MaxHeapFreeRatio=70 Maximum percentage of heap free after GC to avoid shrinking.
-XX:MaxNewSize=size Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a
function of NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86: 2.5m.]
-XX:MaxPermSize=64m Size of the Permanent Generation. [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4
amd64: 96m; 1.3.1 -client: 32m.]
-XX:MinHeapFreeRatio=40 Minimum percentage of heap free after GC to avoid expansion.
-XX:NewRatio=2 Ratio of new/oldgeneration sizes. [Sparc -client: 8; x86 -server: 8; x86 -client: 12.]-client: 4
(1.3) 8 (1.3.1+), x86: 12]
-XX:NewSize=2.125m Default size of new generation (in bytes) [5.0 and newer: 64 bit VMs are scaled 30% larger;
x86: 1m; x86, 5.0 and older: 640k]
-XX:ReservedCodeCacheSize=32m Reserved code cache size (in bytes) - maximum code cache size. [Solaris 64-bit, amd64,
and -server x86: 48m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.]
-XX:SurvivorRatio=8 Ratio of eden/survivor space size [Solaris amd64: 6; Sparc in 1.3.1: 25; other Solaris
platforms in 5.0 and earlier: 32]
-XX:TargetSurvivorRatio=50 Desired percentage of survivor space used after scavenge.
-XX:ThreadStackSize=512 Thread Stack Size (in Kbytes). (0 means use default stack size) [Sparc: 512; Solaris x86:
320 (was 256 prior in 5.0 and earlier); Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0
and earlier); all others 0.]
-XX:+UseBiasedLocking Enable biased locking. For more details, see this tuning example. (Introduced in 5.0 update
6.) [5.0: false]
-XX:+UseFastAccessorMethods Use optimized versionsof Get<Primitive>Field.
-XX:-UseISM Use Intimate Shared Memory. [Not accepted for non-Solaris platforms.] For details, see
Intimate Shared Memory.
-XX:+UseLargePages Use large page memory. (Introduced in 5.0 update 5.) For details, see Java Support for
Large Memory Pages.
-XX:+UseMPSS Use Multiple Page Size Support w/4mb pages for the heap. Do not use with ISM as this
replaces the need for ISM. (Introduced in 1.4.0 update 1, Relevant to Solaris 9 and newer.)
[1.4.1 and earlier: false]
-XX:+UseStringCache Enables cachingof commonlyallocated strings.
-XX:AllocatePrefetchLines=1 Number of cache lines to load after the last object allocationusing prefetch instructions
generated in JIT compiled code. Default values are 1 if the last allocated object was an
instance and 3 if it was an array.
-XX:AllocatePrefetchStyle=1 Generated code style for prefetch instructions.
0 - no prefetch instructions are generate*d*,
1 - execute prefetch instructionsafter each allocation,
2 - use TLAB allocation watermark pointer to gate when prefetch instructions are executed.
-XX:+UseCompressedStrings Use a byte[] for Strings which can be represented as pure ASCII. (Introduced in Java 6
Update 21 Performance Release)
-XX:+OptimizeStringConcat Optimize String concatenationoperations where possible. (Introduced in Java 6 Update 20)
Performance Options
Option and Default Value Description
-XX:-CITime Prints time spent in JIT Compiler. (Introduced in 1.4.0.)
-XX:ErrorFile=./hs_err_pid<pid>.log If an error occurs, save the error data to this file. (Introduced in 6.)
-XX:-ExtendedDTraceProbes Enable performance-impacting dtrace probes. (Introduced in 6. Relevant to
Solaris only.)
-XX:HeapDumpPath=./java_pid<pid>.hprof Path to directory or filename for heap dump. Manageable. (Introduced in 1.4.2
update 12, 5.0 update 7.)
-XX:-HeapDumpOnOutOfMemoryError Dump heap to file when java.lang.OutOfMemoryError is thrown. Manageable.
(Introduced in 1.4.2 update 12, 5.0 update 7.)
-XX:OnError="<cmd args>;<cmd args>" Run user-defined commands on fatal error. (Introduced in 1.4.2 update 9.)
-XX:OnOutOfMemoryError="<cmd args>;
<cmd args>"
Run user-defined commands when an OutOfMemoryError is first thrown.
(Introduced in 1.4.2 update 12, 6)
-XX:-PrintClassHistogram Print a histogram of class instances on Ctrl-Break. Manageable. (Introduced in
1.4.2.) The jmap -histo command provides equivalent functionality.
-XX:-PrintConcurrentLocks Print java.util.concurrent locks in Ctrl-Break thread dump. Manageable.
(Introduced in 6.) The jstack -l command provides equivalent functionality.
-XX:-PrintCommandLineFlags Print flags that appeared on the command line. (Introduced in 5.0.)
-XX:-PrintCompilation Print message when a method is compiled.
-XX:-PrintGC Print messages at garbage collection. Manageable.
-XX:-PrintGCDetails Print more details at garbage collection. Manageable. (Introduced in 1.4.0.)
-XX:-PrintGCTimeStamps Print timestamps at garbage collection. Manageable (Introduced in 1.4.0.)
-XX:-PrintTenuringDistribution Print tenuring age information.
-XX:-TraceClassLoading Trace loading of classes.
-XX:-TraceClassLoadingPreorder Trace all classes loaded in order referenced (not loaded). (Introduced in 1.4.2.)
-XX:-TraceClassResolution Trace constant pool resolutions. (Introduced in 1.4.2.)
-XX:-TraceClassUnloading Trace unloading of classes.
-XX:-TraceLoaderConstraints Trace recording of loader constraints. (Introduced in 6.)
-XX:+PerfSaveDataToFile Saves jvmstat binary data on exit.
-XX:ParallelGCThreads= Sets the number of garbage collection threads in the young and old parallel
garbage collectors. The default value varies with the platform on which the JVM
is running.
-XX:+UseCompressedOops Enables the use of compressed pointers (object references represented as 32
bit offsets instead of 64-bit pointers) for optimized 64-bit performance with Java
heap sizes less than 32gb.
-XX:+AlwaysPreTouch Pre-touch the Java heap during JVM initialization. Every page of the heap is
thus demand-zeroed during initialization rather than incrementally during
application execution.
-XX:AllocatePrefetchDistance= Sets the prefetch distance for object allocation. Memory about to be written with
the value of new objects is prefetched into cache at this distance (in bytes)
beyond the address of the last allocated object. Each Java thread has its own
allocationpoint. The default value varies with the platform on which the JVM is
running.
-XX:InlineSmallCode= Inline a previously compiledmethod only if its generated native code size is less
than this. The default value varies with the platform on which the JVM is
running.
-XX:MaxInlineSize=35 Maximum bytecode size of a method to be inlined.
-XX:FreqInlineSize= Maximum bytecode size of a frequently executed method to be inlined. The
default value varies with the platform on which the JVM is running.
-XX:LoopUnrollLimit= Unroll loop bodies with server compilerintermediate representationnode count
less than this value. The limit used by the server compileris a function of this
value, not the actual value. The default value varies with the platform on which
the JVM is running.
-XX:InitialTenuringThreshold=7 Sets the initialtenuring threshold for use in adaptive GC sizing in the parallel
young collector. The tenuring threshold is the number of times an object
survives a young collection before being promoted to the old, or tenured,
generation.
-XX:MaxTenuringThreshold= Sets the maximum tenuringthreshold for use in adaptive GC sizing. The current
largest value is 15. The default value is 15 for the parallelcollectorand is 4 for
CMS.
Debugging Options
JConsole >java/bin/jconsole
Overview Memory Threads
Classes VM Summary MBean
Java SE Security Overview
Topic Detail
Platform Security
Built-in language security features enforced by the Java compiler and virtual machine:
Strong data typing
Automatic memory management
Bytecode verification
Secure class loading
Cryptography
Comprehensive API with support for a wide range of cryptographic services including
digital signatures, message digests, ciphers (symmetric, asymmetric, stream & block),
message authentication codes, key generators and key factories
Support for a wide range of standard algorithms including RSA, DSA, AES, Triple DES,
SHA, PKCS#5, RC2, and RC4.
PKCS#11 cryptographic token support
Authentication and
Access Control
Abstract authentication APIs that can incorporate a wide range of login mechanisms
through a pluggable architecture.
A comprehensive policy and permissions API that allows the developer to create and
administer applications requiring fine-grained access to security-sensitive resources.
Secure
Communications
APIs and implementations for the following standards-based secure communications
protocols: Transport Layer Security (TLS), Secure Sockets Layer (SSL), Kerberos
(accessible through GSS-API), and the Simple Authentication and Security Layer
(SASL). Full support for HTTPS over SSL/TLS is also included.
Public Key
Infrastructure (PKI)
Tools for managing keys and certificates and comprehensive, abstract APIs with
support for the following features and algorithms:
Certificates and Certificate Revocation Lists (CRLs): X.509
Certification Path Validators and Builders: PKIX (RFC 3280), On-line Certificate Status
Protocol (OCSP)
KeyStores: PKCS#11, PKCS#12
Certificate Stores (Repositories): LDAP, java.util.Collection
Writing a First Java Program
public class Class1 {
public static void main(String[] args) {
System.out.println("Hello World");
}
}
Compile: >javac Class1.java
Execute: >java Class1
Coding Convention
Line Length
Avoid lines longer than 80 characters, since they’re not handled well by
many terminals and tools.
Indentation
Four spaces should be used as the unit of indentation.
Wrapping Lines
When an expression will not fit on a single line, break it according to these
general principles:
• Break after a comma.
• Break before an operator.
• Align the new line with the beginning of the expression at the same level
on the previous line.
Coding Convention
Comments
Java programs can have two kinds of comments: implementation comments and
documentation comments.
- Implementation comments are those found in C++, which are
delimited by /*...*/, and //.
- Documentation comments (known as “doc comments”) are Java-only,
and are delimited by /**...*/. Doc comments can be extracted to HTML files using
the javadoc tool.
Number Per Line
One declaration per line is recommended since it encourages commenting. In
other words,
int level; // indentation level
int size; // size of table
is preferred over
int level, size;
Coding Convention
Placement
Put declarations only at the beginning of blocks. (A block is any code
surrounded by curly braces “{” and “}”.) Don’t wait to declare variables until
their first use; it can confuse the unwary programmer and hamper code
portability within the scope.
void MyMethod() {
int int1; // beginning of method block
if (condition) {
int int2; // beginning of "if" block
...
}
}
Coding Convention
LAB - Installing your Java Development Platform
01 – Install JDK
1.) Download and Install JDK ( eg. jdk-6u25-windows-i586.exe)
from web site http://www.oracle.com/technetwork/java/javase/downloads/index.html
LAB - Installing your Java Development Platform
01 – Install JDK
2.) Select Install Components and Location, Click “Next”.
LAB - Installing your Java Development Platform
01 – Install JDK
3.) Wait for installation, click “Finish”
LAB - Installing your Java Development Platform
02 – Install IDE - JDeveloper
1.) Extract Jdeveloper in to a folder 2.) Execute “jdeveloper.exe”
You can create the shortcut icon .
LAB - Installing your Java Development Platform
02 – Install IDE - JDeveloper
3.) Click “Browse” and select “java.exe” from previous installed JDK
LAB - Installing your Java Development Platform
02 – Install IDE - JDeveloper
4.) Click “OK”, wait until Jdeveloper loaded and see the Jdeveloper welcome screen.
Danairat T.
Line ID: Danairat
FB: Danairat Thanabodithammachari
+668-1559-1446
Thank you

More Related Content

What's hot (20)

PDF
Java EE 與 雲端運算的展望
javatwo2011
 
PPTX
Developing Agile Java Applications using Spring tools
Sathish Chittibabu
 
PPT
Java7
Dinesh Guntha
 
PPT
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
Kwangshin Oh
 
PPTX
What's new in Java 11
Michel Schudel
 
PPT
55 New Features in Java 7
Boulder Java User's Group
 
PDF
Java Threads Tutorial | Multithreading In Java Tutorial | Java Tutorial For B...
Edureka!
 
PDF
Java11 New Features
Haim Michael
 
PPTX
Java and OpenJDK: disecting the ecosystem
Rafael Winterhalter
 
PDF
Bytecode manipulation with Javassist and ASM
ashleypuls
 
PPTX
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Sagar Verma
 
PPS
Packages and inbuilt classes of java
kamal kotecha
 
PDF
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Christian Schneider
 
PDF
55 new things in Java 7 - Devoxx France
David Delabassee
 
PPT
Hibernate introduction
Sagar Verma
 
PPT
Basics of java programming language
masud33bd
 
PPTX
Java servlets
yuvarani p
 
PDF
De Java 8 a Java 17
Víctor Leonel Orozco López
 
PPTX
Build, logging, and unit test tools
Allan Huang
 
PDF
Java Deserialization Vulnerabilities - The Forgotten Bug Class
CODE WHITE GmbH
 
Java EE 與 雲端運算的展望
javatwo2011
 
Developing Agile Java Applications using Spring tools
Sathish Chittibabu
 
CS6270 Virtual Machines - Java Virtual Machine Architecture and APIs
Kwangshin Oh
 
What's new in Java 11
Michel Schudel
 
55 New Features in Java 7
Boulder Java User's Group
 
Java Threads Tutorial | Multithreading In Java Tutorial | Java Tutorial For B...
Edureka!
 
Java11 New Features
Haim Michael
 
Java and OpenJDK: disecting the ecosystem
Rafael Winterhalter
 
Bytecode manipulation with Javassist and ASM
ashleypuls
 
Java Class 6 | Java Class 6 |Threads in Java| Applets | Swing GUI | JDBC | Ac...
Sagar Verma
 
Packages and inbuilt classes of java
kamal kotecha
 
Serial Killer - Silently Pwning your Java Endpoints // OWASP BeNeLux Day 2016
Christian Schneider
 
55 new things in Java 7 - Devoxx France
David Delabassee
 
Hibernate introduction
Sagar Verma
 
Basics of java programming language
masud33bd
 
Java servlets
yuvarani p
 
De Java 8 a Java 17
Víctor Leonel Orozco López
 
Build, logging, and unit test tools
Allan Huang
 
Java Deserialization Vulnerabilities - The Forgotten Bug Class
CODE WHITE GmbH
 

Viewers also liked (20)

PDF
02 basic java programming and operators
Danairat Thanabodithammachari
 
DOC
Web Dictionary
G.C Reddy
 
DOC
Qtp Faq
G.C Reddy
 
ZIP
Introduction to the Java(TM) Advanced Imaging API
white paper
 
PPT
C0 review core java1
tam53pm1
 
PPT
Chapter 4 Powerpoint
Gus Sandoval
 
PPT
Eo gaddis java_chapter_02_5e
Gina Bullock
 
PDF
Java Programming - 04 object oriented in java
Danairat Thanabodithammachari
 
PDF
Java Programming - 03 java control flow
Danairat Thanabodithammachari
 
PDF
Java book for beginners_first chapter
Aamir Mojeeb
 
PPTX
Drawing 1 Module
Fredrik Simons
 
PDF
SeminaronEmpoweringSMEsThroughICTIntervention (1)
Sainath P
 
PPTX
Network
Rachel Espino
 
PPT
Collection Framework in java
CPD INDIA
 
PPTX
Java interview questions 1
Sherihan Anver
 
PPTX
Introduction to Java Strings, By Kavita Ganesan
Kavita Ganesan
 
PPTX
1.3 computer system devices&peripherals
Frya Lora
 
PDF
Java Collections API
Alex Miller
 
DOCX
Project work plan and budget matrix cp 2016
LemardeGuia
 
PDF
The Business value of agile development
Phavadol Srisarnsakul
 
02 basic java programming and operators
Danairat Thanabodithammachari
 
Web Dictionary
G.C Reddy
 
Qtp Faq
G.C Reddy
 
Introduction to the Java(TM) Advanced Imaging API
white paper
 
C0 review core java1
tam53pm1
 
Chapter 4 Powerpoint
Gus Sandoval
 
Eo gaddis java_chapter_02_5e
Gina Bullock
 
Java Programming - 04 object oriented in java
Danairat Thanabodithammachari
 
Java Programming - 03 java control flow
Danairat Thanabodithammachari
 
Java book for beginners_first chapter
Aamir Mojeeb
 
Drawing 1 Module
Fredrik Simons
 
SeminaronEmpoweringSMEsThroughICTIntervention (1)
Sainath P
 
Network
Rachel Espino
 
Collection Framework in java
CPD INDIA
 
Java interview questions 1
Sherihan Anver
 
Introduction to Java Strings, By Kavita Ganesan
Kavita Ganesan
 
1.3 computer system devices&peripherals
Frya Lora
 
Java Collections API
Alex Miller
 
Project work plan and budget matrix cp 2016
LemardeGuia
 
The Business value of agile development
Phavadol Srisarnsakul
 
Ad

Similar to Java Programming - 01 intro to java (20)

PDF
JEE Programming - 01 Introduction
Danairat Thanabodithammachari
 
PPTX
JAVAPart1_BasicIntroduction.pptx
Murugesh33
 
PPTX
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
PDF
Java Basic.pdf
TechSearchWeb
 
PPTX
The Java Story
David Parsons
 
PPT
PPS Java Overview Unit I.ppt
CDSukte
 
PPT
PPS Java Overview Unit I.ppt
RajeshSukte1
 
PPTX
1. Java Project Guidance for engineering
vyshukodumuri
 
PDF
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas Java User Group
 
PDF
Java History and Trends
Dainius Mezanskas
 
PPT
Object Oriented Programming-JAVA
Home
 
PPTX
What is Java | Learn Java | Types of Java
devbhargav1
 
PDF
What is Java | Learn Java | Types of Java
devbhargav1
 
PPTX
UNIT 1.pptx
EduclentMegasoftel
 
PDF
Chapter 1. java programming language overview
Jong Soon Bok
 
PDF
Java course in Chandigarh.pdf
ExcellenceTechnology9
 
PDF
TechSearchWeb.pdf
TechSearchWeb
 
PDF
Technology Tutorial.pdf
TechSearchWeb
 
PDF
What is-java
Shahid Rasheed
 
PPTX
Object Oriented Programming Part 1 of Unit 1
VigneshkumarPonnusam1
 
JEE Programming - 01 Introduction
Danairat Thanabodithammachari
 
JAVAPart1_BasicIntroduction.pptx
Murugesh33
 
JAVA_Day1_BasicIntroduction.pptx
Murugesh33
 
Java Basic.pdf
TechSearchWeb
 
The Java Story
David Parsons
 
PPS Java Overview Unit I.ppt
CDSukte
 
PPS Java Overview Unit I.ppt
RajeshSukte1
 
1. Java Project Guidance for engineering
vyshukodumuri
 
Kaunas JUG#1: Java History and Trends (Dainius Mezanskas)
Kaunas Java User Group
 
Java History and Trends
Dainius Mezanskas
 
Object Oriented Programming-JAVA
Home
 
What is Java | Learn Java | Types of Java
devbhargav1
 
What is Java | Learn Java | Types of Java
devbhargav1
 
UNIT 1.pptx
EduclentMegasoftel
 
Chapter 1. java programming language overview
Jong Soon Bok
 
Java course in Chandigarh.pdf
ExcellenceTechnology9
 
TechSearchWeb.pdf
TechSearchWeb
 
Technology Tutorial.pdf
TechSearchWeb
 
What is-java
Shahid Rasheed
 
Object Oriented Programming Part 1 of Unit 1
VigneshkumarPonnusam1
 
Ad

More from Danairat Thanabodithammachari (20)

PDF
Thailand State Enterprise - Business Architecture and SE-AM
Danairat Thanabodithammachari
 
PDF
Agile Management
Danairat Thanabodithammachari
 
PDF
Agile Organization and Enterprise Architecture v1129 Danairat
Danairat Thanabodithammachari
 
PDF
Blockchain for Management
Danairat Thanabodithammachari
 
PDF
Enterprise Architecture and Agile Organization Management v1076 Danairat
Danairat Thanabodithammachari
 
PDF
Agile Enterprise Architecture - Danairat
Danairat Thanabodithammachari
 
PDF
Digital Transformation, Enterprise Architecture, Big Data by Danairat
Danairat Thanabodithammachari
 
PDF
Big data Hadoop Analytic and Data warehouse comparison guide
Danairat Thanabodithammachari
 
PDF
Big data hadooop analytic and data warehouse comparison guide
Danairat Thanabodithammachari
 
PDF
Perl for System Automation - 01 Advanced File Processing
Danairat Thanabodithammachari
 
PDF
Perl Programming - 04 Programming Database
Danairat Thanabodithammachari
 
PDF
Perl Programming - 03 Programming File
Danairat Thanabodithammachari
 
PDF
Perl Programming - 02 Regular Expression
Danairat Thanabodithammachari
 
PDF
Perl Programming - 01 Basic Perl
Danairat Thanabodithammachari
 
PDF
Setting up Hadoop YARN Clustering
Danairat Thanabodithammachari
 
PDF
JEE Programming - 03 Model View Controller
Danairat Thanabodithammachari
 
PDF
JEE Programming - 05 JSP
Danairat Thanabodithammachari
 
PDF
JEE Programming - 04 Java Servlets
Danairat Thanabodithammachari
 
PDF
JEE Programming - 08 Enterprise Application Deployment
Danairat Thanabodithammachari
 
PDF
JEE Programming - 07 EJB Programming
Danairat Thanabodithammachari
 
Thailand State Enterprise - Business Architecture and SE-AM
Danairat Thanabodithammachari
 
Agile Organization and Enterprise Architecture v1129 Danairat
Danairat Thanabodithammachari
 
Blockchain for Management
Danairat Thanabodithammachari
 
Enterprise Architecture and Agile Organization Management v1076 Danairat
Danairat Thanabodithammachari
 
Agile Enterprise Architecture - Danairat
Danairat Thanabodithammachari
 
Digital Transformation, Enterprise Architecture, Big Data by Danairat
Danairat Thanabodithammachari
 
Big data Hadoop Analytic and Data warehouse comparison guide
Danairat Thanabodithammachari
 
Big data hadooop analytic and data warehouse comparison guide
Danairat Thanabodithammachari
 
Perl for System Automation - 01 Advanced File Processing
Danairat Thanabodithammachari
 
Perl Programming - 04 Programming Database
Danairat Thanabodithammachari
 
Perl Programming - 03 Programming File
Danairat Thanabodithammachari
 
Perl Programming - 02 Regular Expression
Danairat Thanabodithammachari
 
Perl Programming - 01 Basic Perl
Danairat Thanabodithammachari
 
Setting up Hadoop YARN Clustering
Danairat Thanabodithammachari
 
JEE Programming - 03 Model View Controller
Danairat Thanabodithammachari
 
JEE Programming - 05 JSP
Danairat Thanabodithammachari
 
JEE Programming - 04 Java Servlets
Danairat Thanabodithammachari
 
JEE Programming - 08 Enterprise Application Deployment
Danairat Thanabodithammachari
 
JEE Programming - 07 EJB Programming
Danairat Thanabodithammachari
 

Recently uploaded (20)

PPTX
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
PDF
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
PPTX
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PDF
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
PDF
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 
Transforming Mining & Engineering Operations with Odoo ERP | Streamline Proje...
SatishKumar2651
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
IDM Crack with Internet Download Manager 6.42 Build 43 with Patch Latest 2025
bashirkhan333g
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Alarm in Android-Scheduling Timed Tasks Using AlarmManager in Android.pdf
Nabin Dhakal
 
Linux Certificate of Completion - LabEx Certificate
VICTOR MAESTRE RAMIREZ
 
ChiSquare Procedure in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pdf
Varsha Nayak
 
Download Canva Pro 2025 PC Crack Full Latest Version
bashirkhan333g
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Human Resources Information System (HRIS)
Amity University, Patna
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
SAP Firmaya İade ABAB Kodları - ABAB ile yazılmıl hazır kod örneği
Salih Küçük
 

Java Programming - 01 intro to java

  • 1. Module 01 – Introduction to Java Danairat T. Line ID: Danairat FB: Danairat Thanabodithammachari +668-1559-1446
  • 2. Fundamental Java Programming The Course Outline Module 01 – Introduction to Java Module 02 – Basic Java Programming Module 03 – Control Flow and Exception Handling Module 04 – Object Oriented in Java Module 05 – Java Package and Access Control Module 06 – Java File IO Module 07 – Java Networking Module 08 – Java Threading
  • 3. Module 01 – Introduction to Java • Introduction • Java History • Java Principles • Java Platform • HotSpot JVM • Writing a First Java Program • Coding Convention
  • 4. Specific Application Development Knowledge Application Development Knowledge Foundation Programming Knowledge Fundamental Java Programming (Control Flow, OO, Java Network) Java EE and Dev. Frameworks (Containers, Spring, Hibernate, ADF, etc.) SOA, ESB, CEP, BPEL, BPM, ECM Portal, RIA, SSO, IdM Development Lifecycle - Project Mgmt. - Release Mgmt. - Req. Mgmt. (Roles, Event) - Design. Build - Fn & Non-Fn Test - Migrate, Deploy, Monitor - Support Java Developer Trainings
  • 5. Java History Originally, Java developed by James Gosling at Sun Microsystems (which is now a subsidiary of Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. Java applications are compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture.
  • 6. Java History JDK 1.0 (1995) — First Java Released. JDK 1.1 (February 19, 1997) — Major additions included an extensive retooling of the AWT event model, inner classes added to the language, JavaBeans and JDBC. J2SE 1.2 (December 8, 1998) — Codename Playground. This replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). Major additions included reflection, a Collections framework, Java IDL (an IDL implementation for CORBA interoperability), and the integration of the Swing graphical API into the core classes. J2SE 1.3 (May 8, 2000) — Codename Kestrel. Notable changes included the bundling of the HotSpot JVM (the HotSpot JVM was first released in April, 1999 for the J2SE 1.2 JVM), JavaSound, Java Naming and Directory Interface (JNDI) and Java Platform Debugger Architecture (JPDA).
  • 7. Java History J2SE 1.4 (February 6, 2002) — Codename Merlin. This was the first release of the Java platform developed under the Java Community Process as JSR 59. Major changes included regular expressions modeled after Perl, exception chaining, an integrated XML parser and XSLT processor (JAXP), and Java Web Start. J2SE 5.0 (September 30, 2004) — Codename Tiger. Originally numbered 1.5, which is still used as the internal version number. Developed under JSR 176, Tiger added a number of significant new language features including the for-each loop, generics, autoboxing and var-args.
  • 8. Java History Java SE 6 (December 11, 2006) — Codename Mustang — The current version is bundled with a database manager, facilitates the use of scripting languages (currently JavaScript using Mozilla's Rhino engine). As of this version, Sun replaced the name "J2SE" with Java SE and dropped the ".0" from the version number. Other major changes include support for pluggable annotations (JSR 269), lots of GUI improvements, including native UI enhancements to support the look and feel of Windows Vista, and improvements to the Java Platform Debugger Architecture (JPDA) & JVM Tool Interface for better monitoring and troubleshooting Java SE 7 — Codename Dolphin. The Dolphin Project started in August 2006, with release estimated in 2011. New builds including enhancements and bug fixes are released approximately weekly. In addition to the language changes, much more dramatic changes have been made to the Java class library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5.0. Many of the original JDK 1.0 classes and methods have been deprecated.
  • 9. Java Principles There were five primary goals in the creation of the Java language: 1. It should be "simple, object oriented and familiar". 2. It should be "robust and secure". 3. It should be "architecture-neutral and portable". 4. It should execute with "high performance". 5. It should be "interpreted, threaded, and dynamic".
  • 10. Java Platform Java SE (Standard Edition): For general-purpose use on desktop PCs, servers and similar devices. Java EE (Enterprise Edition): Java SE plus various APIs useful for multi-tier client–server enterprise applications. Java ME (Micro Edition): Specifies several different sets of libraries (known as profiles) for devices that are sufficiently limited that supplying the full set of Java libraries would take up unacceptably large amounts of storage. it is not used on any of today's newest mobile platforms (e.g. iPhone, Android, Windows Phone 7, MeeGo, BlackBerry's new QNX). Java Card: A technology that allows small Java-based applications (applets) to be run securely on smart cards and similar small-memory-footprint devices.
  • 11. Java FX A software platform for creating and delivering rich Internet applications that can run across a wide variety of connected devices to build applications for desktop, browser and mobile phones. TV set-top boxes, gaming consoles, Blu-ray players and other platforms are planned. To build JavaFX apps developers use a statically typed, declarative language called JavaFX Script; Java code can be integrated into JavaFX programs. JavaFX is compiled to Java bytecode, so JavaFX applications run on any desktop and browser that runs the Java Runtime Environment (JRE) and on top of mobile phones running Java ME. JavaFX may compete on the desktop with Adobe AIR, Apache Pivot, OpenLaszlo and Microsoft Silverlight.
  • 12. HotSpot JVM providing Java runtime facilities, such as thread and object synchronization, on a variety of operating systems and architectures. It includes dynamic compilers that adaptively compile Java bytecodes into optimized machine instructions and efficiently manages the Java heap using garbage collectors,
  • 13. HotSpot JVM Options Option and Default Value Description -XX:-AllowUserSignalHandlers Do not complain if the application installs signal handlers. (Relevant to Solaris and Linux only.) -XX:AltStackSize=16384 Alternate signal stack size (in Kbytes). (Relevant to Solaris only, removed from 5.0.) -XX:-DisableExplicitGC Disable calls to System.gc(), JVM still performs garbage collection when necessary. -XX:+FailOverToOldVerifier Fail over to old verifier when the new type checker fails. (Introduced in 6.) -XX:+HandlePromotionFailure The youngest generation collection does not require a guarantee of full promotion of all live objects. (Introduced in 1.4.2 update 11) [5.0 and earlier: false.] -XX:+MaxFDLimit Bump the number of file descriptors to max. (Relevant to Solaris only.) -XX:PreBlockSpin=10 Spin count variable for use with -XX:+UseSpinning. Controls the maximum spin iterations allowed before entering operating system thread synchronization code. (Introduced in 1.4.2.) -XX:-RelaxAccessControlCheck Relax the access control checks in the verifier. (Introduced in 6.) -XX:+ScavengeBeforeFullGC Do young generation GC prior to a full GC. (Introduced in 1.4.1.) -XX:+UseAltSigs Use alternate signals instead of SIGUSR1 and SIGUSR2 for VM internal signals. (Introduced in 1.3.1 update 9, 1.4.1. Relevant to Solaris only.) -XX:+UseBoundThreads Bind user level threads to kernel threads. (Relevant to Solaris only.) -XX:-UseConcMarkSweepGC Use concurrent mark-sweep collection for the old generation. (Introduced in 1.4.1) -XX:+UseGCOverheadLimit Use a policy that limits the proportion of the VM's time that is spent in GC before an OutOfMemory error is thrown. (Introduced in 6.) -XX:+UseLWPSynchronization Use LWP-based instead of thread based synchronization. (Introduced in 1.4.0. Relevant to Solaris only.) -XX:-UseParallelGC Use parallel garbage collection for scavenges. (Introduced in 1.4.1) -XX:-UseParallelOldGC Use parallel garbage collection for the full collections. Enabling this option automatically sets -XX:+UseParallelGC. (Introduced in 5.0 update 6.) -XX:-UseSerialGC Use serial garbage collection. (Introduced in 5.0.) -XX:-UseSpinning Enable naive spinning on Java monitor before entering operating system thread synchronizaton code. (Relevant to 1.4.2 and 5.0 only.) [1.4.2, multi-processor Windows platforms: true] -XX:+UseTLAB Use thread-local object allocation (Introduced in 1.4.0, known as UseTLE prior to that.) [1.4.2 and earlier, x86 or with -client: false] -XX:+UseSplitVerifier Use the new type checker with StackMapTable attributes. (Introduced in 5.0.)[5.0: false] -XX:+UseThreadPriorities Use native thread priorities. -XX:+UseVMInterruptibleIO Thread interrupt before or with EINTR for I/O operations results in OS_INTRPT. (Introduced in 6. Relevant to Solaris only.) Behavioral Options Option and Default Value Description -XX:+AggressiveOpts Turn on point performance compiler optimizations that are expected to be default in upcoming releases. (Introduced in 5.0 update 6.) -XX:CompileThreshold=10000 Number of method invocations/branches before compiling [-client: 1,500] -XX:LargePageSizeInBytes=4m Sets the large page size used for the Java heap. (Introduced in 1.4.0 update 1.) [amd64: 2m.] -XX:MaxHeapFreeRatio=70 Maximum percentage of heap free after GC to avoid shrinking. -XX:MaxNewSize=size Maximum size of new generation (in bytes). Since 1.4, MaxNewSize is computed as a function of NewRatio. [1.3.1 Sparc: 32m; 1.3.1 x86: 2.5m.] -XX:MaxPermSize=64m Size of the Permanent Generation. [5.0 and newer: 64 bit VMs are scaled 30% larger; 1.4 amd64: 96m; 1.3.1 -client: 32m.] -XX:MinHeapFreeRatio=40 Minimum percentage of heap free after GC to avoid expansion. -XX:NewRatio=2 Ratio of new/oldgeneration sizes. [Sparc -client: 8; x86 -server: 8; x86 -client: 12.]-client: 4 (1.3) 8 (1.3.1+), x86: 12] -XX:NewSize=2.125m Default size of new generation (in bytes) [5.0 and newer: 64 bit VMs are scaled 30% larger; x86: 1m; x86, 5.0 and older: 640k] -XX:ReservedCodeCacheSize=32m Reserved code cache size (in bytes) - maximum code cache size. [Solaris 64-bit, amd64, and -server x86: 48m; in 1.5.0_06 and earlier, Solaris 64-bit and and64: 1024m.] -XX:SurvivorRatio=8 Ratio of eden/survivor space size [Solaris amd64: 6; Sparc in 1.3.1: 25; other Solaris platforms in 5.0 and earlier: 32] -XX:TargetSurvivorRatio=50 Desired percentage of survivor space used after scavenge. -XX:ThreadStackSize=512 Thread Stack Size (in Kbytes). (0 means use default stack size) [Sparc: 512; Solaris x86: 320 (was 256 prior in 5.0 and earlier); Sparc 64 bit: 1024; Linux amd64: 1024 (was 0 in 5.0 and earlier); all others 0.] -XX:+UseBiasedLocking Enable biased locking. For more details, see this tuning example. (Introduced in 5.0 update 6.) [5.0: false] -XX:+UseFastAccessorMethods Use optimized versionsof Get<Primitive>Field. -XX:-UseISM Use Intimate Shared Memory. [Not accepted for non-Solaris platforms.] For details, see Intimate Shared Memory. -XX:+UseLargePages Use large page memory. (Introduced in 5.0 update 5.) For details, see Java Support for Large Memory Pages. -XX:+UseMPSS Use Multiple Page Size Support w/4mb pages for the heap. Do not use with ISM as this replaces the need for ISM. (Introduced in 1.4.0 update 1, Relevant to Solaris 9 and newer.) [1.4.1 and earlier: false] -XX:+UseStringCache Enables cachingof commonlyallocated strings. -XX:AllocatePrefetchLines=1 Number of cache lines to load after the last object allocationusing prefetch instructions generated in JIT compiled code. Default values are 1 if the last allocated object was an instance and 3 if it was an array. -XX:AllocatePrefetchStyle=1 Generated code style for prefetch instructions. 0 - no prefetch instructions are generate*d*, 1 - execute prefetch instructionsafter each allocation, 2 - use TLAB allocation watermark pointer to gate when prefetch instructions are executed. -XX:+UseCompressedStrings Use a byte[] for Strings which can be represented as pure ASCII. (Introduced in Java 6 Update 21 Performance Release) -XX:+OptimizeStringConcat Optimize String concatenationoperations where possible. (Introduced in Java 6 Update 20) Performance Options Option and Default Value Description -XX:-CITime Prints time spent in JIT Compiler. (Introduced in 1.4.0.) -XX:ErrorFile=./hs_err_pid<pid>.log If an error occurs, save the error data to this file. (Introduced in 6.) -XX:-ExtendedDTraceProbes Enable performance-impacting dtrace probes. (Introduced in 6. Relevant to Solaris only.) -XX:HeapDumpPath=./java_pid<pid>.hprof Path to directory or filename for heap dump. Manageable. (Introduced in 1.4.2 update 12, 5.0 update 7.) -XX:-HeapDumpOnOutOfMemoryError Dump heap to file when java.lang.OutOfMemoryError is thrown. Manageable. (Introduced in 1.4.2 update 12, 5.0 update 7.) -XX:OnError="<cmd args>;<cmd args>" Run user-defined commands on fatal error. (Introduced in 1.4.2 update 9.) -XX:OnOutOfMemoryError="<cmd args>; <cmd args>" Run user-defined commands when an OutOfMemoryError is first thrown. (Introduced in 1.4.2 update 12, 6) -XX:-PrintClassHistogram Print a histogram of class instances on Ctrl-Break. Manageable. (Introduced in 1.4.2.) The jmap -histo command provides equivalent functionality. -XX:-PrintConcurrentLocks Print java.util.concurrent locks in Ctrl-Break thread dump. Manageable. (Introduced in 6.) The jstack -l command provides equivalent functionality. -XX:-PrintCommandLineFlags Print flags that appeared on the command line. (Introduced in 5.0.) -XX:-PrintCompilation Print message when a method is compiled. -XX:-PrintGC Print messages at garbage collection. Manageable. -XX:-PrintGCDetails Print more details at garbage collection. Manageable. (Introduced in 1.4.0.) -XX:-PrintGCTimeStamps Print timestamps at garbage collection. Manageable (Introduced in 1.4.0.) -XX:-PrintTenuringDistribution Print tenuring age information. -XX:-TraceClassLoading Trace loading of classes. -XX:-TraceClassLoadingPreorder Trace all classes loaded in order referenced (not loaded). (Introduced in 1.4.2.) -XX:-TraceClassResolution Trace constant pool resolutions. (Introduced in 1.4.2.) -XX:-TraceClassUnloading Trace unloading of classes. -XX:-TraceLoaderConstraints Trace recording of loader constraints. (Introduced in 6.) -XX:+PerfSaveDataToFile Saves jvmstat binary data on exit. -XX:ParallelGCThreads= Sets the number of garbage collection threads in the young and old parallel garbage collectors. The default value varies with the platform on which the JVM is running. -XX:+UseCompressedOops Enables the use of compressed pointers (object references represented as 32 bit offsets instead of 64-bit pointers) for optimized 64-bit performance with Java heap sizes less than 32gb. -XX:+AlwaysPreTouch Pre-touch the Java heap during JVM initialization. Every page of the heap is thus demand-zeroed during initialization rather than incrementally during application execution. -XX:AllocatePrefetchDistance= Sets the prefetch distance for object allocation. Memory about to be written with the value of new objects is prefetched into cache at this distance (in bytes) beyond the address of the last allocated object. Each Java thread has its own allocationpoint. The default value varies with the platform on which the JVM is running. -XX:InlineSmallCode= Inline a previously compiledmethod only if its generated native code size is less than this. The default value varies with the platform on which the JVM is running. -XX:MaxInlineSize=35 Maximum bytecode size of a method to be inlined. -XX:FreqInlineSize= Maximum bytecode size of a frequently executed method to be inlined. The default value varies with the platform on which the JVM is running. -XX:LoopUnrollLimit= Unroll loop bodies with server compilerintermediate representationnode count less than this value. The limit used by the server compileris a function of this value, not the actual value. The default value varies with the platform on which the JVM is running. -XX:InitialTenuringThreshold=7 Sets the initialtenuring threshold for use in adaptive GC sizing in the parallel young collector. The tenuring threshold is the number of times an object survives a young collection before being promoted to the old, or tenured, generation. -XX:MaxTenuringThreshold= Sets the maximum tenuringthreshold for use in adaptive GC sizing. The current largest value is 15. The default value is 15 for the parallelcollectorand is 4 for CMS. Debugging Options
  • 14. JConsole >java/bin/jconsole Overview Memory Threads Classes VM Summary MBean
  • 15. Java SE Security Overview Topic Detail Platform Security Built-in language security features enforced by the Java compiler and virtual machine: Strong data typing Automatic memory management Bytecode verification Secure class loading Cryptography Comprehensive API with support for a wide range of cryptographic services including digital signatures, message digests, ciphers (symmetric, asymmetric, stream & block), message authentication codes, key generators and key factories Support for a wide range of standard algorithms including RSA, DSA, AES, Triple DES, SHA, PKCS#5, RC2, and RC4. PKCS#11 cryptographic token support Authentication and Access Control Abstract authentication APIs that can incorporate a wide range of login mechanisms through a pluggable architecture. A comprehensive policy and permissions API that allows the developer to create and administer applications requiring fine-grained access to security-sensitive resources. Secure Communications APIs and implementations for the following standards-based secure communications protocols: Transport Layer Security (TLS), Secure Sockets Layer (SSL), Kerberos (accessible through GSS-API), and the Simple Authentication and Security Layer (SASL). Full support for HTTPS over SSL/TLS is also included. Public Key Infrastructure (PKI) Tools for managing keys and certificates and comprehensive, abstract APIs with support for the following features and algorithms: Certificates and Certificate Revocation Lists (CRLs): X.509 Certification Path Validators and Builders: PKIX (RFC 3280), On-line Certificate Status Protocol (OCSP) KeyStores: PKCS#11, PKCS#12 Certificate Stores (Repositories): LDAP, java.util.Collection
  • 16. Writing a First Java Program public class Class1 { public static void main(String[] args) { System.out.println("Hello World"); } } Compile: >javac Class1.java Execute: >java Class1
  • 17. Coding Convention Line Length Avoid lines longer than 80 characters, since they’re not handled well by many terminals and tools. Indentation Four spaces should be used as the unit of indentation. Wrapping Lines When an expression will not fit on a single line, break it according to these general principles: • Break after a comma. • Break before an operator. • Align the new line with the beginning of the expression at the same level on the previous line.
  • 18. Coding Convention Comments Java programs can have two kinds of comments: implementation comments and documentation comments. - Implementation comments are those found in C++, which are delimited by /*...*/, and //. - Documentation comments (known as “doc comments”) are Java-only, and are delimited by /**...*/. Doc comments can be extracted to HTML files using the javadoc tool. Number Per Line One declaration per line is recommended since it encourages commenting. In other words, int level; // indentation level int size; // size of table is preferred over int level, size;
  • 19. Coding Convention Placement Put declarations only at the beginning of blocks. (A block is any code surrounded by curly braces “{” and “}”.) Don’t wait to declare variables until their first use; it can confuse the unwary programmer and hamper code portability within the scope. void MyMethod() { int int1; // beginning of method block if (condition) { int int2; // beginning of "if" block ... } }
  • 21. LAB - Installing your Java Development Platform 01 – Install JDK 1.) Download and Install JDK ( eg. jdk-6u25-windows-i586.exe) from web site http://www.oracle.com/technetwork/java/javase/downloads/index.html
  • 22. LAB - Installing your Java Development Platform 01 – Install JDK 2.) Select Install Components and Location, Click “Next”.
  • 23. LAB - Installing your Java Development Platform 01 – Install JDK 3.) Wait for installation, click “Finish”
  • 24. LAB - Installing your Java Development Platform 02 – Install IDE - JDeveloper 1.) Extract Jdeveloper in to a folder 2.) Execute “jdeveloper.exe” You can create the shortcut icon .
  • 25. LAB - Installing your Java Development Platform 02 – Install IDE - JDeveloper 3.) Click “Browse” and select “java.exe” from previous installed JDK
  • 26. LAB - Installing your Java Development Platform 02 – Install IDE - JDeveloper 4.) Click “OK”, wait until Jdeveloper loaded and see the Jdeveloper welcome screen.
  • 27. Danairat T. Line ID: Danairat FB: Danairat Thanabodithammachari +668-1559-1446 Thank you