2. 2
Course Syllabus
Java Training Course Content
Overview of Object-Oriented Programming Language
Introduction to JAVA
Array in Java
Control Statement in Java
3. 3
Course Syllabus, cont.
Important Concept in Java
static,final,interface,abstractclass,super keyword
Wrapper classes
Exception Handling
User-Defined Package
IO Package(File Handling)
Lang Package
4. Course Syllabus, cont.
Java Database Connectivity (JDBC)
Collections and Generics Framework
Threads
J2EE
JSP & Servlet
XML
Struts
4
5. Computer Programming
The history of computer programming is a steady move
away from machine-oriented views of programming
towards concepts and metaphors that more closely reflect
the way in which we ourselves understand the world
Programming has progressed through:
– machine code
– assembly language
– machine-independent programming languages
– procedures & functions
– objects
5
8. Machine-Independent Programming Languages –
Fortran
This example program solves for roots of the quadratic equation,
! ax^2 +bx +c =0,for given values of a, b and c.
!
PROGRAM bisection
IMPLICIT NONE
INTEGER :: iteration
DOUBLE PRECISION :: CC, Er, xl, x0, x0_old, xr
! Set convergence criterion and guess for xl, xr.
CC = 1.d-4
xl = 8.d-1
xr = 11.d-1
! Bisection method.
Er =CC +1
iteration = 0
DO WHILE (Er > CC)
iteration = iteration + 1
! Compute x0 and the error.
x0_old = x0
x0 = (xl + xr) / 2.d0
Er = DABS((x0 - x0_old)/x0)*100.d0
WRITE (*,10) iteration, x0_old, x0, Er
10 FORMAT (1X,I4,3(2X,E10.4))
8
9. Procedures & Functions – Pascal
program ValueArg(output);
{Shows how to arrange for a procedure to have arguments.}
procedure PrintInitials(First, Last : char);
{Within this procedure, the names First and Last represent the argument
values. We’ll call write to print them.}
begin
write(‘My initials are: ’);
write(First);
writeln(Last)
end; {PrintInitials}
begin
PrintInitials (‘D’, ‘C’); {Any two characters can be arguments.}
PrintInitials (‘Q’, ‘T’); {Like strings, characters are quoted.}
PrintInitials (‘&’, ‘#’)
end. {ValueArg}
9
10. Objects
10
class Time {
private int hour, minute;
public Time (int h, int m) {
hour = h;
minute = m;
}
public void addMinutes (int m) {
int totalMinutes =
((60*hour) + minute + m) % (24*60);
if (totalMinutes<0)
totalMinutes = totalMinutes + (24*60);
hour = totalMinutes / 60;
minute = totalMinutes % 60;
}
}
Java
13. 13
History
James Gosling and Sun Microsystems
Oak
Java, May 20, 1995, Sun World
HotJava
– The first Java-enabled Web browser
JDK Evolutions
J2SE, J2ME, and J2EE (not mentioned in the
book, but could discuss here optionally)
16. 16
JDK Editions
Java Standard Edition (J2SE)
– J2SE can be used to develop client-side standalone
applications or applets.
Java Enterprise Edition (J2EE)
– J2EE can be used to develop server-side applications
such as Java Servlet and Java Server Pages.
Java Micro Edition (J2ME).
– J2ME can be used to develop applications for mobile
devices such as cell phones.
Java Enterprise Edition 5(JEE5)
– Framework such as Struts,hibernet,spring
17. 17
Java IDE Tools
Forte by Sun Microsystems
Borland JBuilder
Microsoft Visual J++
Web Gain Café
IBM Visual Age for Java
Eclipse Helios
Net Beans
18. 18
Getting Started with Java
Programming
A Simple Java Application
Compiling Programs
Executing Applications
19. 19
A Simple Application
Example 1.1
//This application program prints Welcome
//to Java!
package chapter1;
public class Welcome {
public static void main(String[] args) {
System.out.println("Welcome to Java!");
}
}
RunRunSourceSource
NOTE: To run the program,
install slide files on hard
disk.
20. 20
Creating and Compiling Programs
On command line
– javac file.java Source Code
Create/Modify Source Code
Compile Source Code
i.e. javac Welcome.java
Bytecode
Run Byteode
i.e. java Welcome
Result
If compilation errors
If runtime errors or incorrect result
21. 21
Executing Applications
On command line
– java classname
Java
Interpreter
on Windows
Java
Interpreter
on Sun Solaris
Java
Interpreter
on Linux
Bytecode
...
23. 23
Compiling and Running a Program
Where are the files
stored in the
directory?c:example
chapter1 Welcome.class
Welcome.java
chapter2
.
.
.
Java source files and class files for Chapter 2
chapter19 Java source files and class files for Chapter 19
Welcome.java~
24. Evolutions
24
Core Java J2EE JEE5
J2EE - Its a Technology used to develop Enterprise Applications like 2,3 or
n-tire architecture using a Client/Server model over Distributed Enterprise
environment.It Application Uses Java as Programming Language
J2SE - Java Standard Edition is a Programming Language using we can
develop Desktop Application, Web Enterprise Application, Mobile
Application and much more thing.
25. 25
Major Areas of a Java Program
Exception
Collection(utill package)
Lang package
JDBC
I/O Package
26. Fees Structure
Fees is not Constant.
If u refer friend it will be varied.
Registration fees will be 1000/- and
remaining 4000 /- pay on during the class.
Batch on :Saturday & Sunday and One week
days
26
First Class: Introduction, Prerequisites, Advices, Syllabus
Lab 1: Create a Java Project, Compile, and Run.
Show syntax errors
Print program
Capture screen shots, and save it in Word, and print it.
Homework One: Check in the class randomly.